AudioOutputUnit and QT audio extraction - back to basics
AudioOutputUnit and QT audio extraction - back to basics
- Subject: AudioOutputUnit and QT audio extraction - back to basics
- From: Ray Garcia <email@hidden>
- Date: Mon, 3 Apr 2006 20:59:32 -0500
Okay, given that I went through the exercise of simplifying away my
AUGraph to just a single AudioOutputUnit, and set its output device
and stream format to match the float32 noninterleaved data coming out
of QT, added a buffer transfer module to properly pull data from the
QT buffers over to the smaller AudioUnit bufers, and have run aground
on error 1718449215 while attempting to initialize the output AU, I
went looking for more blessed sample code and a simple approach for
what I think should be a simple task.
A simpler architecture for feeding short bursts of audio to an output
audio unit is hypothetically the following..
Setup:
create default AudioOutputUnit
create QT audio extraction session
read session ASBD
revise session ASBD to be float32 format, noninterleaved
compute number of audio frames needed per video frame (effectively
burst length)
set AU's input (port 0, input context) ASBD to be QT's outgoing ASBD
set AU's input ACL to be QT's outgoing ACL
Set AU's render callback
Initialize AU
Start-Playback-At-Time:
Set QT extraction start time
Start AU
Render callback:
If extraction time (guarded by mutex) has changed, restart audio-
frame countdown and move QT extraction start time
If no more audio frames to read, fill outgoing AU buffers with 0.0;
otherwise have QT fill AU's buffers with extracted sound data
Is there anything I'm missing (or doing redundantly) that will
prevent this from working? Are there further preconditions to
initializing an output AU, for instance? I'm assuming a
ScheduledAudioPlayer AU isn't needed at all if the playback time is
always "immediately if not sooner"? I
Thanks.
_______________________________________________
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