ExtAudioFileOpenURL and associated functions...
ExtAudioFileOpenURL and associated functions...
- Subject: ExtAudioFileOpenURL and associated functions...
- From: Richard Burnett <email@hidden>
- Date: Fri, 17 Apr 2009 12:03:44 -0400
Hello All!
I am trying to open an audio file and store the data in memory as interleaved 8.24 fixed OR as two buffers in a buffer list non-interleaved 8.24 fixed for use with an AudioUnit output. I am clearly doing something wrong, or just missing some key concept of what it is supposed to be doing.
I am assuming my problem is coming from kExtAudioFileProperty_ClientDataFormat and/or kExtFileProperty_ClientChannelLayout.
The file I am loading in is 16 bit 44.1k interleaved wav file. I create an AudioStreamBasicDescription to send to ClientDataFormat and set it as such:
outputFormat.mSampleRate = 44100.0;
outputFormat.mFormatID = kAudioFormatLinearPCM;
outputFormat.mFormatFlags = kAudioFormatFlagsAudioUnitCanonical;
outputFormat.mBytesPerPacket = sizeof(AudioUnitSampleType)*2;
outputFormat.mFramesPerPacket = 1;
outputFormat.mBytesPerFrame = sizeof(AudioUnitSampleType)*2;
outputFormat.mChannelsPerFrame = 2;
outputFormat.mBitsPerChannel = 8 * sizeof(AudioUnitSampleType);
outputFormat.mReserved = 0;
Where I think I am getting confused is with how this controls ExtAudioFileRead. When using ExtAudioFileRead, how do I control how it fills the buffer? If I wanted to write interleaved stereo audio into a buffer OR non-interleaved stereo audio into two buffers of an AudioBufferList?
I have searched through the documentation, but I don't quite understand how to control all of this. I think the code I took this from originally was using it all as mono, so I converted everything to work stereo in the AudioUnit which I have tested and it works (wrote a function inside my buffer filling function to just generate 8.24 fixed sin wave.
When I send the buffer contents to the buffer filling routing, I can kinda hear the sound from the audio file mixed with A LOT of noise and glitching and panning issues, so clearly I am doing something VERY wrong! :)
Any help would be greatly appreciated.
Rick
_______________________________________________
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