RE: ExtAudioFile - mono to stereo
RE: ExtAudioFile - mono to stereo
- Subject: RE: ExtAudioFile - mono to stereo
- From: "Edwards, Waverly" <email@hidden>
- Date: Fri, 20 Aug 2010 16:53:02 -0500
- Acceptlanguage: en-US
- Thread-topic: ExtAudioFile - mono to stereo
Thank you Mo for helping me to understand how this works. Just as I think I comprehend
I find that I have a partial understanding.
I see in "Example 3" references mapping a mono to stereo.
I will see how I can implement this but there is something I really don't understand.
Based on what I am seeing, you can get the input files format and say, no I don't really
want that format, change the client format properties *before* actually reading the input
and the data will written to the conversion buffer. My input file, though in a different
format will automagically changed to the input that I actually want? Looking at the documentation
I would not get that I anything but PCM data in whatever format the original contained, whether that
be 22050 sample rate, mono channel. I may not have a grip on the documentation but I'm thinking
the conversion takes place when the data gets written to disk. By way of example, if I have a
one second sine wave sampled at 22050 Hz, I could ask for a conversion of sample rate to 44100 Hz and
so upon conversion my [input] buffer before anything is written to file will contain 44100 sample
not 22050 as was in the actual file.
Is this a valid understanding of how this process can work.
err = ExtAudioFileSetProperty(inputFileRef,
kExtAudioFileProperty_ClientDataFormat,
sizeof(AudioStreamBasicDescription),&audioFormat);
then change other properties
err = ExtAudioFileGetProperty(inputFileRef,
kExtAudioFileProperty_AudioConverter,
&size,&convRef);
SInt32 channelMap[2] = {0,0};
err = ExtAudioFileSetProperty(convRef,
kAudioConverterChanelMap,
sizeof(channelMap),&channelMap);
// Read the data into a buffer and if the file was mono the buffer will be in stereo???
If this is a correct understanding of how this process can work then there is a lot more
to these API's than meets the eye.
Thank you,
W.
-----Original Message-----
From: coreaudio-api-bounces+waverly.edwards=email@hidden [mailto:coreaudio-api-bounces+waverly.edwards=email@hidden] On Behalf Of Mo DeJong
Sent: Thursday, August 19, 2010 11:01 PM
To: email@hidden
Subject: Re: ExtAudioFile - mono to stereo
On Thu, Aug 19, 2010 at 5:42 PM, William Stewart <email@hidden> wrote:
> You can - you use the AudioConverter (which is part of the ExtAudioFile's
> implementation) and you tell it to map the 1 channel source of the file, to
> a 2 channel client data format (you want your data in stereo). So, you:
You can find a working example of this logic in "Example 4" here:
http://www.modejong.com/iPhone/
cheers
Mo
_______________________________________________
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
_______________________________________________
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