• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Using non-interleaved buffers with an AudioConverter
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Using non-interleaved buffers with an AudioConverter


  • Subject: Re: Using non-interleaved buffers with an AudioConverter
  • From: Heath Raftery <email@hidden>
  • Date: Thu, 01 Sep 2005 09:26:37 +1000

Did you get any further with this? There's a couple of things that come to mind, but I haven't looked into it too deeply:

On 25/08/2005, at 9:14 AM, Stephen Shaw wrote:
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

But you know the output device will have an ASBD of its own. Regardless of what you feed into the AudioConverter, you must make sure the outputASBD matches the OutputDevice you are targeting, right?


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;

Did you get these back to front? If this is the non interleaved version, where is kAudioFormatFlagIsNonInterleaved?


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

And mBuffers[1] exists? If it is, then CoreAudio is expecting two non- interleaved channels, which would be a good thing. Just confirm that ioData->mNumberOfBuffers (or whatever it is) is 2.


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.

Any reason you can't use the interleaved method then?

Is there something else I need to do? Does anyone know of any examples that
use this playback method?

No I don't I'm afraid. Heath

_______________________________________________
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


References: 
 >Using non-interleaved buffers with an AudioConverter (From: Stephen Shaw <email@hidden>)

  • Prev by Date: Re: IO Cycle Telemetry Window
  • Previous by thread: Using non-interleaved buffers with an AudioConverter
  • Next by thread: kAudioDevicePropertyPlayThruDestination
  • Index(es):
    • Date
    • Thread