Using non-interleaved buffers with an AudioConverter
Using non-interleaved buffers with an AudioConverter
- Subject: Using non-interleaved buffers with an AudioConverter
- From: Stephen Shaw <email@hidden>
- Date: Wed, 24 Aug 2005 16:14:27 -0700
- Thread-topic: Using non-interleaved buffers with an AudioConverter
Hi, I hope someone has tried this before and has some tips. I'm trying to
play 2 non interleaved buffers instead of 1 interleaved buffer
For the non interleaved version I'm using the following
AudioStreamBasicDescription to make the AudioConverter to feed the
OutputUnit.
inputASBD.mSampleRate = sOutputFrequency;
inputASBD.mFormatID = kAudioFormatLinearPCM;
inputASBD.mFormatFlags = kAudioFormatFlagIsBigEndian |
kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked; //0xe
inputASBD.mBytesPerPacket = 4;
inputASBD.mFramesPerPacket = 1;
inputASBD.mBytesPerFrame = 4;
inputASBD.mChannelsPerFrame = 2;
inputASBD.mBitsPerChannel = sizeof (SInt16) * 8;
inputASBD.mReserved = 0;
For the interleaved version I'm using the following
AudioStreamBasicDescription to make the AudioConverter to feed the
OutputUnit.
inputASBD.mSampleRate = sOutputFrequency;
inputASBD.mFormatID = kAudioFormatLinearPCM;
inputASBD.mFormatFlags = kAudioFormatFlagIsBigEndian |
kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsPacked |
kAudioFormatFlagIsNonInterleaved;
inputASBD.mBytesPerPacket = 4;
inputASBD.mFramesPerPacket = 1;
inputASBD.mBytesPerFrame = 4;
inputASBD.mChannelsPerFrame = 2;
inputASBD.mBitsPerChannel = sizeof (SInt32) * 8;
inputASBD.mReserved = 0;
Instead of two 16bit buffer mixed into one 32 bit interleaved buffer I have
two 32 bit buffers.
In the ComplexInputFunc callback for the AudioConverter, I'm using the
following to set the buffer pointers.
ioData->mBuffers[0].mData = sLeftMixBuffer; // tell the
Audio Converter where it's source data is
ioData->mBuffers[0].mDataByteSize = bytesReturned; // tell
the Audio Converter how much source data there is
ioData->mBuffers[1].mData = sRightMixBuffer; // tell the
Audio Converter where it's source data is
ioData->mBuffers[1].mDataByteSize = bytesReturned; // tell
the Audio Converter how much source data there is
The newAudioConverter call succeeds, everything 'appears' to work, the
callback is called, but I get no audio. It does work if I use the
interleaved method.
Is there something else I need to do? Does anyone know of any examples that
use this playback method?
Thanks for your help in advance!
-stephen
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden