• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Getting playback time from output AudioUnit
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Getting playback time from output AudioUnit


  • Subject: Re: Getting playback time from output AudioUnit
  • From: Zulfiqar Malik <email@hidden>
  • Date: Fri, 20 Aug 2010 16:08:15 +0100

This is exactly what I do in the RenderCallback with PostRender action. However this does not give me enough accuracy to do a perfect lip sync between the video and the audio. I have to make the audio go with the video and not the other way round. I was able to do this easily with OpenAL in the initial implementation. I had to shift to CoreAudio because I wanted the fancy graph based DSP system which i need for advanced audio processing.

I am frustrated to the point where I am just thinking of dumping CoreAudio and writing my own completey SSE optimized software DSP system. I have wasted so much with scarce documentation and bad error codes :(. The most frustrating library I have ever worked with :(.

Patrick Muringer wrote:
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.



--
Zulfiqar Malik
The Foundry, 1 Wardour Street, London, W1D 6PA, UK
Tel: +44 (0)20 7434 0449 - Fax: +44 (0)20 7434 1550
Web: www.thefoundry.co.uk

The Foundry Visionmongers Ltd.
Registered in England and Wales No: 4642027

 _______________________________________________
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

References: 
 >Getting playback time from output AudioUnit (From: Zulfiqar Malik <email@hidden>)
 >Re: Getting playback time from output AudioUnit (From: Patrick Muringer <email@hidden>)

  • Prev by Date: Re: Getting playback time from output AudioUnit
  • Next by Date: RE: AudioFileCreateWithURL returns -50 error on iPhone Simulator
  • Previous by thread: Re: Getting playback time from output AudioUnit
  • Next by thread: Re:running certain spectral(?) plugins faster-than-realtime ... issues
  • Index(es):
    • Date
    • Thread