Re: Inter-app synchronization
Re: Inter-app synchronization
- Subject: Re: Inter-app synchronization
- From: Jeff Moore <email@hidden>
- Date: Fri, 2 Mar 2007 17:14:34 -0800
On Mar 2, 2007, at 4:41 PM, Brian Willoughby wrote:
I have a question about a feature that I am not working on at the
moment, so hopefully I can phrase it correctly despite not being dug
in with all the technical details.
How would I code a program such that it could play audio in sync
with another application using CoreAudio?
It depends on how you want to define "play audio in sync". If two apps
are using the same device for IO, they are already in synch in terms
of delivering data to the device. The two apps would be working in the
same time domain.
Would it be sufficient to use the high-resolution CoreAudio time
reference and select wall-clock as the source? In other words, this
would make the computer sync to its own internal clock. Would both
applications play sample-accurate sync in this manner?
If they are playing to the same device, they are in synch. But you
don't really need an external time source when the device's clock
would do nicely for this purpose.
What if I want to use one of the many SMPTE devices on my system for
sync? I haven't examined Audio MIDI Setup and the MIDI routing, but
I assume that I could either duplicate the SMPTE MIDI stream and
send it to multiple apps, or at least find some way to connect a
SMPTE input to the computer so that all applications can select it
as a time reference.
The IAC driver would certainly make this possible. But again, the
device's clock should be more than enough for the job.
Sorry for the somewhat vague questions, but I don't want to wait
until I'm working on this to ask. Basically, what are the
recommendations for coding in CoreAudio with the goal of system-wide
synchronization between applications. I'm specifically leaving out
the case of one app being master for other apps, and rather focusing
on the computer being the master or an external SMPTE reader being
the master.
The easiest thing to do is to just use the device's clock. The HAL is
already delivering it to all the processes so that leaves just the
inter-application messaging to worry about.
--
Jeff Moore
Core Audio
Apple
_______________________________________________
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