Re: non real time bouncing and music events
Re: non real time bouncing and music events
- Subject: Re: non real time bouncing and music events
- From: Bill Stewart <email@hidden>
- Date: Sat, 18 May 2002 12:46:59 -0700
Yes you can
Basically you have to start the sequence as you would normally.
The difference is in how you interact with the graph...
You'll need an output unit that is a generic based one (not a device based
one) - this is a new audio unit (Generic Output) that is available in Jaguar
(and there is a new set of classes already for this in the AudioUnit SDK if
you want to make your own)
When you start the sequence (MusicPlayerStart), this will turn around and
start the graph, which will turn around and start your output unit.
OK - so you should install a property listener on the generic output (which
you've added to the graph of course - a gotcha! - if you had been using this
graph with a device output unit, then you'll have to remove the device
output unit first - then add the generic output and connect it up - an
AUGraph can only have one output unit at a time)
OK - so the property you listen for is the isRunning notification.
That will fire when you start the graph.
Then, in your notification you now know that the graph is ready to go. The
generic output unit however, does nothing, so you have to do the work. But
its simple...
You call the generic output unit's RenderSlice call - supplying a buffer of
data that you will get filled by the graph. You're also responsible of
course, for mainting the validity of the time stamps - in this case the only
valid field of the time stamp I would guess is the sample count (though you
could supply a host time stamp as well, but as you're rendering in an
offline situation, you probably don't want to do that).
Each time your render slice returns you now should have a buffer of rendered
audio - which you could then write out to disk. Then pull on it again
(incrementing your sample count), until you have the data you need.
Then when you're done, you call stop on the sequence (MusicPlayerStop) -
you'll get the notification that you've been stopped, but of course you
already know that!
That should be it.
This sounds like a good piece of sample code to write - so I'll endeavour to
do that before we're finished with Jaguar (good way to test that this all
works as we expect it to!)
Bill
on 18/5/02 11:21 AM, Jean-Alexis Montignies wrote:
>
I imagine it's possible to use a audio graph for processing audio to
>
save it to disk by pulling samples as fast as the graph can process them.
>
>
The question is :
>
How can you feed a synth unit when you're not in real time?
>
>
I don't see how to use a MusicSequence.
>
>
Would it be possible to use an audio unit to pull music events? (The
>
role of the unit would be to send music event when asked to fill a
>
buffer)
>
>
Jean-Alexis Montignies
>
Sen:te
>
_______________________________________________
>
coreaudio-api mailing list | email@hidden
>
Help/Unsubscribe/Archives:
>
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
>
Do not post admin requests to the list. They will be ignored.
mailto:email@hidden
tel: +1 408 974 4056
__________________________________________________________________________
"Thousands of years ago, cats were worshipped as gods. We have never
forgotten this."
__________________________________________________________________________
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.