Re: Newbie (*AudioDeviceIOProc) question
Re: Newbie (*AudioDeviceIOProc) question
- Subject: Re: Newbie (*AudioDeviceIOProc) question
- From: Tommy Braas <email@hidden>
- Date: Wed, 14 May 2003 12:07:58 -0700
Dom,
Let me see if I can answer your questions!
The function pointer type *AudioDeviceIOProc, which is defined in the
CoreAudio API, is a callback function type. It defines what a valid
callback function should look like in terms of its argument types and
the order of the arguments. The CoreAudio engine calls that function,
provided it has been registered for a device and that device is
running, whenever data is available for reading, or the device is ready
to receive data. All input and output buffers for a device are
presented simultaneously to the callback function.
So, on line 149 of SineWave.m
err = AudioDeviceAddIOProc(device, appIOProc, (void *) def); //
setup our device with an IO proc
The appIOProc is registered for 'device' as the callback function for
audio input and output.
Then on line 152 of the same file
err = AudioDeviceStart(device, appIOProc); // start playing
sound through the device
The device is started, specifying the appIOProc once again. A device
can have many registered AudioDeviceIOProc, only the ones that are
"started" will receive callbacks, thence the need to specify the
callback function name again.
I hope this email sheds some light!
Thanks,
Tommy Braas
deep sea software
On Tuesday, May 13, 2003, at 14:50 US/Pacific, email@hidden wrote:
Hi All, Brad Ford recently mentioned the code at
http://www.audiosynth.com/sinewavedemo.html, I've understood most of
what's done in this code except for the definition of its appIOProc
function. Specifically how are some of the arguments called? They are
in the argument list in (*AudioDeviceIOProc) and in appIOProc but no
where else in the code. I realize this is a very important function
and I would like to understand it better. Does anyone know of any
resources or other examples that may clear up my confusion?
Thanks for the help,
Dom Ochotorena
_______________________________________________
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.
_______________________________________________
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.