Re: AudioConverter and interleaving woes
Re: AudioConverter and interleaving woes
- Subject: Re: AudioConverter and interleaving woes
- From: "Malcolm Haylock" <email@hidden>
- Date: Sun, 10 Oct 2004 20:30:49 +1000 (EST)
- Importance: Normal
Thanks Jeremy,
The AudioStreamBasicDescription fields I'm using allow for this difference
in the meaning of the mBytesPerFrame and mBytesPerPacket fields depending
on the interleaving flag (see below).
Why doesn't the AudioConverter expect the same size buffer for input and
output when all I'm doing is de-interleaving? I've tried telling the
AudioConverter that the out buffer size is 1/8th of the input buffer but
then allocating the full amount (8 times what I tell it) but this just
gives a bus error.
Malcolm
> Malcolm,
>
> From CoreAudioTypes.h
>
> // However, when an ASBD has the kAudioFormatFlagIsNonInterleaved flag,
> the AudioBufferList has a different
> // structure and semantic. In this case, the ASBD fields will describe
> the format of ONE of the AudioBuffers
> // that are contained in the list, AND each AudioBuffer in the list is
> determined to have a single (mono) channel
> // of audio data. Then, the ASBD's mChannelsPerFrame will indicate the
> total number of AudioBuffers that are
> // contained within the AudioBufferList - where each buffer contains
> one channel. This is used primarily with
> // the AudioUnit (and AudioConverter) representation of this list - and
> typically won't be found in the AudioHardware usage of
> // this structure.
>
> On Oct 9, 2004, at 2:08 PM, Malcolm Haylock wrote:
>
>> Hi Everyone,
>>
>> I'm having troubles using an AudioConverter to de-interleave an
>> 8-channel
>> stream.
>>
>> The formats are:
>>
>>
>> Input is interleaved:
>>
>> mSampleRate = 44100
>> mFormatID = kAudioFormatLinearPCM
>> mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
>> | kLinearPCMFormatFlagIsBigEndian
>> | kLinearPCMFormatFlagIsPacked
>> mFramesPerPacket =1
>> mChannelsPerFrame = 8
>> mBitsPerChannel = 32
>> mBytesPerPacket = 32
>> mBytesPerFrame = 32
>>
>>
>> Output is same as input but not interleaved:
>>
>> mSampleRate = 44100
>> mFormatID = kAudioFormatLinearPCM
>> mFormatFlags = kLinearPCMFormatFlagIsSignedInteger
>> | kLinearPCMFormatFlagIsBigEndian
>> | kLinearPCMFormatFlagIsPacked
>> | kAudioFormatFlagIsNonInterleaved
>> mFramesPerPacket =1
>> mChannelsPerFrame = 8
>> mBitsPerChannel = 32
>> mBytesPerPacket = 4
>> mBytesPerFrame = 4
>>
>> 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?
>>
>> Thanks,
>> Malcolm Haylock
>>
>> _______________________________________________
>> Do not post admin requests to the list. They will be ignored.
>> Coreaudio-api mailing list (email@hidden)
>> Help/Unsubscribe/Update your Subscription:
>> email@hidden
>>
>> This email sent to email@hidden
>>
>
>
_______________________________________________
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