2009-05-17 41 views
2

您能指出我的文檔/片段/博客嗎?請解釋如何在iPhone上記錄Apple無損音頻文件。請在iPhone上記錄「Apple lossless」音頻

我檢查了開發中心的Apple 音頻記錄器示例,但無法弄清楚,我有 用於無損音頻的設置。

問候,

斯特凡

回答

6

的iPhone OS支持記錄使用多種不同的壓縮音頻編碼格式文件的.caf:

蘋果無損 - kAudioFormatAppleLossless

的iLBC(互聯網低比特率的編碼解碼器) - kAudioFormatiLBC

IMA/ADPCM(又名IMA4) - kAudioFormatAppleIMA4

μLaw - kAudioFormatULaw

阿勞 - kAudioFormatALaw

- (id) initWithURL: fileURL { 
    NSLog (@"initializing a recorder object."); 
    self = [super init]; 

    if (self != nil) { 

     // define the audio stream basic description for the file to record into 

     // record audio at the current hardware sample rate 
     // make sure the audio session is active before asking for properties 
     UInt32 propertySize = sizeof(audioFormat.mSampleRate); 
     AudioSessionGetProperty(kAudioSessionProperty_CurrentHardwareSampleRate, 
           &propertySize, 
           &audioFormat.mSampleRate); 

     audioFormat.mFormatID   = kAudioFormatAppleIMA4; // record using IMA4 codec 
     audioFormat.mChannelsPerFrame = 1; 

     AudioQueueNewInput(&audioFormat, ...); 

     ... 

    } 

    return self; 
} 

你肯定會想閱讀Audio Queue Services Programming Guide

0

看看在蘋果iPhone開發中心SpeakHere例子。

+0

我已經使用了SpeakHere。但它是用於錄製CAF的,可惜MP4沒有損失。不管怎麼說,還是要謝謝你。 – Stefan 2009-05-17 20:16:51

0

我用的iTalk記錄保費爲.AIFF(未壓縮),然後導出到筆記本電腦,並使用後手壓縮它 - 它默認情況下保留時間戳。

flac --best *.aiff