iOS AUGraph offline render
iOS AUGraph offline render
- Subject: iOS AUGraph offline render
- From: Gregory Wieber <email@hidden>
- Date: Sat, 5 Feb 2011 12:40:35 -0800
Hello,
I've been reading everything I can find in the lists regarding outputting to an audio file from an AUGraph -- I'm lost.
My graph has a remoteIO node, connected to a multichannel mixer. That multichannel mixer has an inputRenderProc that calls AudioUnitRender on another multichannel mixer, and that mixer has lots of other mixers connected to each of its busses. This all works great in real time.
Now, I'd like to bounce a performance to an audio file. What I've tried so far is:
- set up an audio file
- stop the graph
- remove the remoteIO unit
- get a generic io unit, describe the format, etc.
- attach a render input proc to the generic output unit
- start the graph
- enter a loop where I create a bufferlist, fill out a timestamp, etc
- look at my saved performance data, see if any note ons / offs should occur, trigger them, etc
- call audiounitrender on the generic output unit & write the buffer list to a file:
FillOutAudioTimeStampWithSampleTime(timeStamp, sampleTime);
result = AudioUnitRender(mBounce, 0, &timeStamp, 0, numSamples,bufferList);
result = AudioFileWriteBytes(myAudioFile, false, currentByte, &inNumBytes, &bufferList->mBuffers[0].mData);
- increment my sample time, performance time, etc
- free the bufferlist * buffers
- exit the loop
I should note that the generic output node's rendercallback simply calls audiounitrender for the mutlichannel mixer that's connected to all the other multichannel mixers (in much the same way everything works in the real-time context)
Now, I get a wav file out of this that is the right length of time, but it's filled with noise. It turns out that while the generic output node's callback is executed, the audiounitrender I call within that callback is not (executed). I'm assuming the noise is junk in the buffer from when it's allocated, and that no data is ever actually being output from the render callback (since the only callback that seems to get called is the generic output's.)
What am I failing to understand here? Do I have to tell all of the other nodes in my graph that they're no longer operating in real-time context (this is on iOS, and the offline properties don't seem to be available). It seems that when I'm using the generic output node instead of a remoteIO node, there is no 'pull' to the graph. I was under the assumption that if I called audiounitrender on something, it would pull from all connected nodes. But, again, it seems like my audiounitrender call inside my generic output node doesn't actually do anything.
Pulling my hair out over this one for days now, any help is greatly appreciated.
best,
Greg
_______________________________________________
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