Re: How Can I Determine When a ScheduledAudioFileRegion Has Finished Playing?
Re: How Can I Determine When a ScheduledAudioFileRegion Has Finished Playing?
- Subject: Re: How Can I Determine When a ScheduledAudioFileRegion Has Finished Playing?
- From: Andy Davidson <email@hidden>
- Date: Sun, 27 Jan 2013 09:24:38 -0800
- Thread-topic: How Can I Determine When a ScheduledAudioFileRegion Has Finished Playing?
Hi nketter
I wound up calculating the play length and using a NSTimer. I forgot the details but one of the things I tried was using a ??render callback ??? To keep track of playback position. The problem I ran into with this approach was the timestamps where hard to use. If I remember correctly for unknown reasons I was getting back system times instead of time relative to my time line. I could never figure out how to convert from system time to relative time
The NSTimer works surprisingly well for playback.
Andy
From: n ketter < email@hidden> Date: Sunday, January 27, 2013 8:28 AM To: < email@hidden> Subject: How Can I Determine When a ScheduledAudioFileRegion Has Finished Playing?
I asked this on SO but haven't received any replies so thought I'd try here...
On iOS, I have an Audio Unit of type kAudioUnitSubType_AudioFilePlayer wrapped by an AUNode and connected to a multichannel mixer and remote IO (output) in an Audio Graph. While the graph is playing I want to loop the file and be able to determine when the AudioFilePlayer has reached the end of the file, so that I can perform an operation before it begins the next iteration of its loop.
In reviewing AudioUnitProperties.h, while there is a completion callback - mCompletionProc - it's only called when the disk has read the file and scheduled it for playback, not when it has actually finished playing back the audio. So then I considered storing the length of the audio (packets/frames) as a property and, in an input callback attached to another input of the mixer, checking to see if we're at the end of the file. But that callback doesn't get called every frame, so it's likely that the end of the file would be reached before my callback is invoked.
Has anyone run up against this problem before and solved it or have ideas for how I might approach it?
Thanks in advance.
_______________________________________________
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
|
_______________________________________________
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