Re: How to perform fast forward/rewind with AudioQueue
Re: How to perform fast forward/rewind with AudioQueue
- Subject: Re: How to perform fast forward/rewind with AudioQueue
- From: "Xu Ting" <email@hidden>
- Date: Sat, 4 Oct 2008 15:02:15 +0900
Hi, bill,
Thank you for your kindness reply, but I still not quite understand Audio Queue.
Hi, Craig,
I
think with your help, I had figured out how to perform fast forward and
rewind, but I still have some questions about some details.
Q1. When I specify a packet index to be read, should I clean the buffer?
Don't have to - audio file is going to write into that buffer
If I don't clear the buffer, after I set the next packet index to be read, the original buffer data will be played, am I right?
I have watched the iPod app on iPhone, and it does not have any
latency when I push the fast forward button or rewind button. So, if I
do not clear the buffer, how could I guarantee I can play the next
audio data as soon as possible?
If so, how should I do? I had tried free buffer and refill the buffer from the packet index, but it did not work correctly.
there
must be a bug in your code - the audio file is reading the file based
on the information you are providing it - whether you are reading
"sequentially" or from some arbitrary spot in the file should not mean
anything to the file object.
Yes, I had finally figured it out.
Now, no matter what packet index I set to the audio file, it will read
the correct data. Thank you.
Q2. After I clicked the fast forward button or rewind button, I found
out that the AudioQueueGetCurrentTime doesn't work as I expected. How
should I get the correct time? Should I calculate the time by current
packet index? If so, I can not get the correct packet index which is
currently playing. How should I get the correct packet index?
the
queue has no notion of where in a file you are providing data. it is
providing you with a time since you started playing - but has no idea
about what that means from your point of view as the data provider.
so the way you need to do this is to associate the
buffers you enqueue with a time in the aq timeline (so you know when
that buffer is going to be played). then, based on what "time in the
file" a given buffer represents, you can then find out where in your
timeline, the "current time" of the queue corresponds too.
I am not quite understand you here. Did you mean, I need to create an
AudioTimeStamp object(For example
aTimeStamp) by using
AudioQueueCreateTimeline, and then using the
AudioQueueEnqueueBufferWithParameters, and pass the
aTimeStamp object to it?
Actually, here is most hard to understand part for me, as I reading the
Aduio Queue Service Reference.
I had checked these functions one by one, I don't think what I said
above is correct. So, bill, could you give me a right way? If it is
possible, I want to know the exact function name. Maybe there is some
misunderstanding when I read the reference. But I really stucked in
this problem for too many days...
Thank you,
Best Regards,
-Tonny
--
Life is like a box of chocolates, u never know what u'r gonna get.
_______________________________________________
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