2014-03-13 226 views
1

哪種音頻格式體積較小,用於ios中的語音錄製?質量不一定是最好的,但用戶說話的內容應該是可以理解的。ios中的音頻錄製格式

+0

查看這篇文章中的所有鏈接。它可能會幫助你http://stackoverflow.com/questions/1761460/supported-audio-file-formats-in-iphone – Mani

回答

0

假設你打算使用AVAudioRecorder類,你應該提供錄音設置像這樣 -

NSDictionary *recordSettings = [NSDictionary dictionaryWithObjectsAndKeys: 
    [NSNumber numberWithInt:AVAudioQualityMin], AVEncoderAudioQualityKey, 
    [NSNumber numberWithInt:16], AVEncoderBitRateKey, 
    [NSNumber numberWithInt: 2],AVNumberOfChannelsKey, 
    [NSNumber numberWithFloat:44100.0], AVSampleRateKey,nil]; 


NSError* error = nil; 
AVAudioRecorder audioRecorder = [[AVAudioRecorder alloc] 
            initWithURL:soundFileURL 
            settings:recordSettings 
            error:&error]; 

Apple's documentation提供了有關設置常數(特別是AVEncoderAudioQualityKey),你可以在你的應用程序中使用的詳細信息。

+0

我有一個關於'AVEncoderBitRateKey'的問題,它是每秒kbits?或每秒位數? – specialvict

0

22.05KHz的單聲道對於語音來說已經足夠了,而且在同樣的位深度下,立體聲的大小是44.1KHz的1/4。你甚至可能會嘗試將其降至11.025KHz。

0

幾個iOS應用使用Speex編碼器進行低碼率語音。它不是內置的,但開放源碼source code可用於編碼。