Re: AudioQueue and seeking through file
Re: AudioQueue and seeking through file
- Subject: Re: AudioQueue and seeking through file
- From: "Matthew Leon Grinshpun" <email@hidden>
- Date: Sat, 10 May 2008 09:31:57 -0400
On Thu, May 8, 2008 at 6:21 AM, Thomas Clement <email@hidden> wrote:
> While this does work, I can still hear half a second of audio (the currently
> used buffer I presume) before it switches to the new position.
> I tried filling the buffers with the new audio data between the calls to
> AudioQueueStop and AudioQueueStart but the playback just stops almost
> immediately after calling AudioQueueStart and without any error.
>
> Any idea?
I use the following code and it works just fine... (mStartPacket is
just a value used to calculate elapsed time, you can ignore it). This
way when AudioQueueStop is run, it fills the buffer with audio data
from the location we want to seek to.
-Matthew
- (void)seekToPacket:(NSNumber *)packet
{.
self.track.state = kMLTrackSeeking;
aqData.mCurrentPacket = packet.longLongValue;
aqData.mStartPacket = aqData.mCurrentPacket;
NSLog(@"%s Attempting to seek to packet %qi", _cmd, aqData.mStartPacket);
[self logError:AudioQueueStop(aqData.mQueue, true)];
self.track.state = kMLTrackPlaying;
[self logError:AudioQueueStart(aqData.mQueue, NULL)];
}
_______________________________________________
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