I faced the same problem. I have a player which renders the waveform of the 
audio it’s playing, and allows the user to click on that to jump to the clicked 
spot. Files are anywhere from a second to an hour in duration.

I tried all kinds of timers and main thread updates - all useless on short 
files - before I thought of trying ‘CoreAnimation’. It moves the ‘wiper’ on its 
own clock, no need to call it from the render callback. It just needs to know 
where to start, and how long to take to get to the end.

It works brilliantly, on the shortest or longest file.

I just set the animation duration to the remaining time of the clip from the 
start or clicked point, and the framework provides ultra smooth movement that 
is synchronized to the file.

Check CoreAnimation out!

Rob



  However, this causes everything to slow down to the point that the audio plays
>>      with clicks and gaps inbetween the frames..
>> 
>>      I changed this to do a performSelectorOnMainThread, where this operation
>>      occurs, but it seems like the playhead only gets updated a handful of 
>> times
>>      during playback, so it does not look good..
>> 
>>      What is the ideal way to get visual feedback like this during playback?
>> 
>>      Thanks!


 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to