Audio Unit/AudioConverter and getting what's playing *now*
Audio Unit/AudioConverter and getting what's playing *now*
- Subject: Audio Unit/AudioConverter and getting what's playing *now*
- From: Simon Fraser <email@hidden>
- Date: Thu, 21 Oct 2004 23:23:41 -0700
I'm playing streamed PCM data via an output Audio Unit with on-the-fly
conversion with an AudioConverter and AudioConverterFillComplexBuffer(),
using code based on the "PlayAudioFileLite" sample:
<http://developer.apple.com/samplecode/PlayAudioFileLite/listing1.html>
My problem is that this sound has to sync to video. There's a delay
between calling AudioOutputUnitStart() and the sound coming out, I think
because of some thread starvation issues that mean that my
ACComplexInputProc can't always supply as many packets as the converter
wants (which may happen because of network bandwidth issues in the
normal course of events). So I need to be able to ask the audio device
(or some other component) the timestamp of the samples that are
currently being played.
I've tried getting the audio device for the AU with
AudioUnitGetProperty(myUnit, kAudioOutputUnitProperty_CurrentDevice,
kAudioUnitScope_Output...), and then calling
AudioDeviceGetCurrentTime(), but this just returns the number of samples
processed since I called AudioOutputUnitStart() (ie. it continues to
increase even during the initial period of silence).
AudioDeviceTranslateTime() didn't seem to help me either.
Any suggestions appreciated.
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