Re: How does one update a view position during a core audio render callback?
Re: How does one update a view position during a core audio render callback?
- Subject: Re: How does one update a view position during a core audio render callback?
- From: Robert Martin <email@hidden>
- Date: Sat, 07 Mar 2015 14:53:21 -0500
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@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden