Sample rate conversion - 8000.0 Hz sample rate on iPhone 6s and iPhone 6s Plus

Hi,

I'm having some issues with the iPhone 6s in my app.

In my VoIP app I'm using OpenCore AMR to transfer audio through the internet. This codec only supports 8000Hz sample rate and because my app is a legacy app I can not change the codec.

This is the AudioStreamBasicDescription I must use to be compatible with other devices using my app:

static const int kBytesPerSample = sizeof(SInt16);
streamFormat_.mFormatID = kAudioFormatLinearPCM;
streamFormat_.mFormatFlags = kAudioFormatFlagIsPacked | kAudioFormatFlagIsSignedInteger;
streamFormat_.mChannelsPerFrame = 1;
streamFormat_.mFramesPerPacket = 1;
streamFormat_.mBytesPerPacket = kBytesPerSample;
streamFormat_.mBytesPerFrame = kBytesPerSample;
streamFormat_.mBitsPerChannel = 8 * kBytesPerSample;
streamFormat_.mSampleRate = 8000.0;

Now, I'd like to configure TAAE to use that AudioStreamBasicDescription but I think that is not possible on the iPhone 6s as it doesn't output well with that sample rate. Not quite sure if it is even recording at that sample rate.

Is there any way to make that sample rate conversion with TAAE?
I believe this can be done using AudioConverterFillComplexBuffer but I'm not sure how to use it to transform the data that comes from the internet into something the iPhone 6s likes.

Thank you very much in advance

Sign In or Register to comment.