---------- Forwarded message ---------- From: Dave O'Neill <[email protected]> Date: Sun, Mar 8, 2015 at 10:48 AM Subject: Re: Fwd: How does one update a view position during a core audio render callback? To: "Patrick J. Collins" <[email protected]>
Did you try running the example I made? https://gist.github.com/dave234/72bce8798dc7b1ade48b It's not meant to be a shining example of how to get a playhead position so much as it is to show a simple way of getting a value that is set from the render thread without potential blocking/obj-c messaging. And to demonstrate that the timer works fine and doesn't slow down when added with NSRunLoopCommonModes. If you don't add your timer with timerWithTimeInterval instead of using scheduledtimerwithtimeinterval then adding it to a run loop will have no effect. On Sun, Mar 8, 2015 at 10:36 AM, Patrick J. Collins < [email protected]> wrote: > > It looks like your timer might not be firing consistently. I would test > that first. I'm not sure > > what else is going on in your Application but if there is any tracking > then a timer will be > > blocked. If your timer isn't firing as expected try adding it like this: > > NSTimer *timer = [NSTimer timerWithTimeInterval:1.0 / 60.0 > target:self > > selector:@selector(moveBox) userInfo:nil repeats:1]; > > [[NSRunLoop mainRunLoop]addTimer:timer forMode:NSRunLoopCommonModes]; > > Yeah unfortunately this didn't work either... It seems that it fires > properly until audio starts playing, and then the timer callback > frequency goes down to the point that it only gets called 5 or 6 times > over a 1.6 second period... Super weird. > > Patrick J. Collins > http://collinatorstudios.com >
_______________________________________________ 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]
