Another Audio Units/"playing now" question
Another Audio Units/"playing now" question
- Subject: Another Audio Units/"playing now" question
- From: Simon Fraser <email@hidden>
- Date: Thu, 28 Oct 2004 12:19:52 -0700 (PDT)
Folling up from my previous post about how to get at the timestamp of
the audio that is currently playing (which I didn't really resolve),
I have another related question.
To recap, I'm playing audio with an Audio Unit which has to sync to
video, so it's important that I can get some kind of timestamp for
the audio that's currently playing. I'm feeding PCM data to the audio
unit via a render callback, which in turn uses an AudioConverterRef to
potentially do upsampling.
That render callback gets a timestamp which appears to contain the
same absolute time that I'd get by calling AudioGetCurrentHostTime()
(i.e. something that's not too useful in this context).
The user can pause audio/video playback, which I implement via
AudioOutputUnitStop()/AudioOutputUnitStart(). However, I now have to
take into account "paused" time when generating timestamps to sync with
the video, which seems clumsy. So I'm still looking for some way to
ask the Audio Unit (or some underlying API) how much time it has
spent playing audio since the last 'start' call.
Is there any other way to do this, other than to perhaps track the
number of samples supplied in the callback, and convert to time based on
the sample rate?
Any input, or suggestions for different ways to approach this, are
appreciated.
Thanks
Simon
_______________________________________________
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