Re: Getting playback time from output AudioUnit
Re: Getting playback time from output AudioUnit
- Subject: Re: Getting playback time from output AudioUnit
- From: Patrick Muringer <email@hidden>
- Date: Fri, 20 Aug 2010 16:59:46 +0200
I don't know if that might help. I store the inSampleTime
(inSampleTimeAtStart) the first time I'm in the CallBack (Sample
number)
Each time I'm in the callback, I use the current inSampleTime as
follow: (currentSampleTime-inSampleTimeAtStart)/44100 (if your freq
is this one)
Not sure it is what you need.
P
Le 20/08/2010 16:41, Zulfiqar Malik a écrit :
Hi,
I am developing a low latency high performance audio system using
CoreAudio that plays in sync with a video playback system. I have
got most done, however, I need to know how many samples have been
rendered by the output unit at any given instance. I need this for
synchronization. Depending on this result I will need to speed up
or slow the audio down ever so slightly to get it to play in sync
with the video.
However, I am unable to find any such functionality. I am using a
HALOutput audio unit. The seconds and milliseconds
AudioUnitParameters return a not supported error code. I have
tried getting the time from the AudioDevice but that doesn't
return me a relative time. I am incredibly frustrated by the lack
of useful documentation and flexibility of the AudioUnit API.
Using AudioQueues or OpenAL is not an option. All I want to get my
synchronization logic working is to get the current number of
samples rendered by the output unit.
Any help would be appreciated.
Thank you.
P.S. I am currently making it work by adding up the samples in
RenderOutput function but its not accurate and can easily go
wrong. Its not something I can depend on. I need more accuracy.
|
_______________________________________________
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