我正在使用音頻設備錄製一些PCM音頻。在回調中,當我有30秒的音頻時,我想要以12kb/s比特率寫入8000Hz AAC編碼文件的磁盤。如何在Coreaudio中爲AudioStreamBasicDescription指定比特率?
這是我使用的AudioStreamBasicDescription,但我的輸出結果是40 kb/s。我的問題是,我可以改變一些參數來降低比特率,如果是這樣,我修改哪些參數?
// specify the M4A
AudioStreamBasicDescription outputFormat = {0};
outputFormat.mSampleRate = 8000.0;
outputFormat.mFormatID = kAudioFormatMPEG4AAC;
outputFormat.mFormatFlags = kMPEG4Object_AAC_Main;
outputFormat.mChannelsPerFrame = 1;
謝謝,這就是我一直在尋找的東西。 – blueether
這設置位深度,但不是位速率,是否正確?比特深度是16比特或24比特,而比特率是128kbps – user1021430
@ user1021430,我同意你的意見。你知道設置比特率的正確方法嗎? – mbaros