Re: AudioQueue and seeking through file
Re: AudioQueue and seeking through file
- Subject: Re: AudioQueue and seeking through file
- From: Thomas Clement <email@hidden>
- Date: Sat, 10 May 2008 16:01:19 +0200
Matthew Leon Grinshpun wrote :
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)];
}
You're right, the result is a lot better if I change the packet offset
before calling AudioQueueStop.
I didn't though AudioQueueStop would fill the buffers. I should have
tried exactly what you told me in your first e-mail.
Thanks a lot!
Thomas
_______________________________________________
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