Re: Trying to port my app to Core Audio. Audio Sync
Re: Trying to port my app to Core Audio. Audio Sync
- Subject: Re: Trying to port my app to Core Audio. Audio Sync
- From: James McCartney <email@hidden>
- Date: Mon, 2 Feb 2004 19:18:31 -0800
On Feb 2, 2004, at 6:42 PM, Ralph Hill wrote:
Thanks James, I will look further into the audio output unit. It may
be easier to use than the HAL.
Based on a conversation with someone else, it occurs to me that I did
not make something clear.
Latency from when sound data is presented to the audio software, and
when it is heard, is not an issue for me. The Play method I am trying
to write queues audio to be played behind other audio that has been
queued by earlier calls. I don't care (much) how long it takes to get
to the output jacks. But the Play method must be able to return an
estimate of when the sound just queued will first reach the output
jacks.
OK then you've got no problem.
Latency from when the ioProc takes a sample and it hits the jack can be
determined exactly as long as the driver writers did their job.
The ioProc provides an output timestamp which is the time that sample
will go to the driver. To that you need to add the stream and device
latencies. Then you will have the time that the audio hits the metal.
The latency for each is got by calling AudioDeviceGetProperty and
AudioStreamGetProperty of kAudioDevicePropertyLatency.
So, to make things work, I still need to know how to determine when my
audio will reach the output jacks, and whether I can force the HAL to
use buffers of ~10msec (or less), or if it does by default.
set kAudioDevicePropertyBufferFrameSize.
-
james mccartney
apple coreaudio
_______________________________________________
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.