Silent AudioRender/ExtAudio Recording Failure
Silent AudioRender/ExtAudio Recording Failure
- Subject: Silent AudioRender/ExtAudio Recording Failure
- From: Seth Willits <email@hidden>
- Date: Mon, 17 Oct 2011 12:42:17 -0700
Hi all,
I'm using Core Audio to record from a given input device and write to a file. I'm basically using the exact code from this Apple sample code, and described in this technote:
http://developer.apple.com/library/mac/#technotes/tn2091/_index.html
http://developer.apple.com/library/mac/#samplecode/RecordAudioToFile/Listings/DCAudioFileRecorder_cpp.html#//apple_ref/doc/uid/DTS10003986-DCAudioFileRecorder_cpp-DontLinkElementID_3
I find the audio output unit, enable IO, hook it up to a given audio device, set the input render callback, and set the audio format for the unit to output data to, initialize it and then start running it. For the file part, I use ExtAudioFile to create a file, set the audio format, channel map, etc.
In the audio render callback, I call AudioUnitRender(), and return its reported error if had one, otherwise I call ExtAudioFileWriteAsync and return its error result. If an error occurs from calling either function, I stop the audio output unit and report the error in the UI.
What's happening (and unfortunately *I* can't repeat this), is the audio file is somehow shorter than the recording should be, like the recording stops early but isn't reported. For example, during a 5 minute recording, the audio file is only 3 minutes long. What I'm wondering is, where else can errors bubble up from within the AudioUnit and ExtAudio APIs? Is there some other error reporting mechanism I'm not watching and that's why it's failingly silently? Am I doing something wrong?
--
Seth Willits
_______________________________________________
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