Converting non-interleaved PCM audio to interleaved (so it can be written to QuickTime file)
Converting non-interleaved PCM audio to interleaved (so it can be written to QuickTime file)
- Subject: Converting non-interleaved PCM audio to interleaved (so it can be written to QuickTime file)
- From: Mark <email@hidden>
- Date: Tue, 08 Mar 2011 09:38:54 +0100
Hello
in my app I am using QTKit to capture PCM audio and later writing that to a QuickTime movie. We need more control over movie creation than QTKit supplies, so we are doing it manually (AddMediaSampleReference).
I was able to get it working for mono audio (eg from Build in display mic).
For stereo, I see the CoreAudio ASBD coming out of QTKit is non-interleaved (kAudioFormatFlagIsNonInterleaved). If I try to pass that on to QuickTime, it crashes, if I remove the interleaved flag from the ASBD, the file is written correctly, but I get some weird distorted sound.
So, looks like I need to interleave the audio manually before passing it on to QuickTime.
Now, I have no clue of CoreAudio at all - can someone point me in the right direction.
I just found the "Audio Converter Services Reference" in the docs. Looks like that it can be used with buffers (AudioConverterConvertBuffer) for simple conversions - which is my case. Still, I have no idea how to instantiate and configure such an object.
Any help greatly appreciated.
Regards
mark _______________________________________________
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