• 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: AudioConverter and interleaving woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioConverter and interleaving woes


  • Subject: Re: AudioConverter and interleaving woes
  • From: Brad Ford <email@hidden>
  • Date: Sun, 10 Oct 2004 13:13:38 -0700

The input and output buffers should be the same size, but when I use
AudioConverterGetProperty() to find the input buffer size for a given
output buffer size (flag
kAudioConverterPropertyCalculateInputBufferSize),
it tells me that the input buffer size should be 8 times the output
buffer
size. Therefore any call to AudioConvertBuffer will fail if I give it
the
same size buffers.

What is going on - is this an incorrect use for AudioConverters?


Malcom,
I think you need to think of buffer size in the context of an AudioBufferList. When deinterleaving, the input format is 8-channel, 32-bit integer interleaved, in other words, you'd describe it in an AudioBufferList as:


bl->mNumberBuffers = 1;
bl->mBuffers[0].mNumberChannels = 8;
bl->mBuffers[0].mDataByteSize = 32 (bits) * 8 (channels) * n (frames);
bl->mBuffers[0].mData = ptrToBigBuffer;

Whereas, on the output side, you have deinterleaved, meaning an audio buffer list with 8 separate buffers, each one is 1/8th the size of your input buffer list's single data buffer:

outBL->mNumberBuffers = 8;
outBL->mBuffers[0].mNumberChannels = 1;
outBL->mBuffers[0].mDataByteSize = 32 (bits) * 1 (channel) * n (frames);
outBL->mBuffers[0].mData = ptrToBufferForChannel1;

....etc (for 8 buffers)

The calculateInputBufferSize call is probably expecting that the number of bytes you specify to be equal to the number of bytes you want in each AudioBuffer. So the fact that it's giving you a number that is 8 times greater is correct.

-Brad Ford
QuickTime Engineering

_______________________________________________
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: 
 >AudioConverter and interleaving woes (From: "Malcolm Haylock" <email@hidden>)
 >Re: AudioConverter and interleaving woes (From: Jeremy Sagan <email@hidden>)
 >Re: AudioConverter and interleaving woes (From: "Malcolm Haylock" <email@hidden>)

  • Prev by Date: Re: Does the Varispeed Unit support multi channels in phase
  • Next by Date: 2nd Post: Wrong format reported by AudioFileGetProperty()?!?
  • Previous by thread: Re: AudioConverter and interleaving woes
  • Next by thread: Does the Varispeed Unit support multi channels in phase
  • Index(es):
    • Date
    • Thread