I'm using speak here code for audio recording with audio format kAudioFormatMPEG4AAC. How can i change bit rate to 96K, 128K or 320K?
Regards, John
I'm using speak here code for audio recording with audio format kAudioFormatMPEG4AAC. How can i change bit rate to 96K, 128K or 320K?
Regards, John
I'm not sure if you can do this directly using AudioQueue by setting a parameter. However, I think the following approach will work:
I haven't tried this on iOS, but if the AAC encoder is using a hardware codec I doubt you will be able to set the bitrate. AudioFormat.h gives some methods to determine which codecs are hardware vs. software and ways to request one implementation vs. another.
The fact is, AudioQueue is using the same backend as AudioConverter, although there is no key for bitRate in AudioQueueProperty enom, you can still borrow them from converter. Get the bit rate like this:
AudioQueueGetProperty(mQueue, kAudioConverterEncodeBitRate, &bitRate, &propertySize);
and set it like this:
AudioQueueSetProperty(mQueue, kAudioConverterEncodeBitRate, &bitRate, propertySize);