Re: playing audio files separated by specified time intervals
Re: playing audio files separated by specified time intervals
- Subject: Re: playing audio files separated by specified time intervals
- From: "tahome izwah" <email@hidden>
- Date: Mon, 22 Dec 2008 09:59:01 +0100
They count the samples that are being shuffled to the output device
and add the sample frames from their sound files in the appropriate
places. You don't need a clock for this at all, just insert the sample
frames from your audio file to the output in your render callback.
Since this is driven by the output devices' clock it is as accurate as
it can get.
HTH,
--th
2008/12/22 Maissam Barkeshli <email@hidden>:
> Thanks for the help.
>
> I'm still a little bit confused though about how this specifically should
> work. Say I want to do something simple: play a single audio file once per
> second and simultaneously update a visual counter on the GUI.
>
> Right now I'm looking at starting a CoreAudioClock, running a loop and
> continuously polling the clock to see whether a second has passed since the
> last time. Once at least one second has passed, then play the file and
> update the display. The problem with this is that even though CoreAudioClock
> is very accurate, the program itself sometimes might actually take an extra
> fraction of a second if the computer is busy with other applications.
> But people still develop rock-solid metronome applications, with displays
> and everything. How do they do it? The only thing I can think of about
> making this work is that somehow I need to be using a thread that has
> extremely high priority, so that the operating system focuses on this
> particular program.
>
> Perhaps I have settle with not being able to get the display to be perfectly
> accurate, but with your suggestion I can get the audio to be accurate?
>
_______________________________________________
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