Re: AudioConverter question.
Re: AudioConverter question.
- Subject: Re: AudioConverter question.
- From: James McCartney <email@hidden>
- Date: Thu, 14 Nov 2002 14:06:05 -0800
On Thursday, November 14, 2002, at 01:39 AM, Fredrik Oja wrote:
>
Hi list,
>
>
I'm trying to use an AudioConverter to convert my 16khz, mono, 16bit
>
linear data to what my device prefer. In this case to 44.1khz 32bit
>
(float) stereo data. This works fine, except that the converter only
>
writes data to the left channel. My workaround is to copy each sample
>
from the left channel into the right channel. Is this intendent
>
behaviour of the AudioConverter? If it is, is there someway I can tell
>
the converter to write the same data to the right channel too?
>
You can set the channel map property so that it copies your channels.
Otherwise the default is to put zeroes in extra channels.
Here is the property from AudioConverter.h. The comment describes the
default behaviour which is what you are seeing. Setting the channel map
to {0,0} will get both output channels copied from the mono input
channel.
kAudioConverterChannelMap = 'chmp',
// An array of SInt32's. The size of the array is the number of
output
// channels, and each element specifies which input channel's
// data is routed to that output channel (using a 0-based index
// of the input channels), or -1 if no input channel is to be
// routed to that output channel. The default behavior is as follows.
// I = number of input channels, O = number of output channels.
// When I > O, the first O inputs are routed to the first O outputs,
// and the remaining puts discarded. When O > I, the first I inputs
are
// routed to the first O outputs, and the remaining outputs are
zeroed.
---
James McCartney email@hidden
Apple CoreAudio
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.