Streaming Graph to file
Streaming Graph to file
- Subject: Streaming Graph to file
- From: Geoff Hufford <email@hidden>
- Date: Fri, 03 Mar 2006 14:20:12 -0600
I am subclassing the Public utility class CAAudioFileReader as the source
for a graph that plays several files simultaneously. The graph is organized
with an OutputUnit -> Main StereoMixer -> StereoMixer(s)->
CAAudioFileReader(s) input proc. Now I am trying to refine a (better than
real-time) saving to a file strategy.
Approach 1:
I subclassed the Public utility class CAAudioFileWriter.
Set up the desired file settings.
Repeatedly call AudioUnitRender on the Main Stereo mixer in the graph
followed by CAAudioFileReader::PushBuffer
Managing the process is difficult, and I am having audio dropouts in the
saved file. Firstly, the AudioUnitRender function may trigger threaded file
reading, so subsequent AudioUnitRender calls may not have the data loaded to
succeed. The second difficulty is knowing if the writer is getting behind.
Approach 2:
I havent written it yet but I am considering switching to use ExtAudioFile.
My plan is using ExtAudioFileCreateNew. Then get the
kAudioUnitProperty_StreamFormat from the Mixer in the graph. Set
ExtAudioFileSetProperty - kExtAudioFileProperty_ClientDataFormat from the
mixer. I will still need to call AudioUnitRender on the mixer and then pass
it to ExtAudioFileWrite.
Any advice? Is there an even better approach? Ideally i wish I could just
hook the file to the graph instead of an output unit and just start the
graph.
Regards,
Geoff Hufford
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