Re: Ring buffer design for MP3 (et. al.) playback
Re: Ring buffer design for MP3 (et. al.) playback
- Subject: Re: Ring buffer design for MP3 (et. al.) playback
- From: "Andreas Falkenhahn" <email@hidden>
- Date: Mon, 15 Oct 2007 20:41:43 +0200
On 15.10.2007 at 10:26 Richard Powell wrote:
>Hello Andreas,
>
>A suggestion: Maybe you can track how many buffers have been
>decoded? For MP3 and AAC the number of frames decoded is constant
>through-out the life of the file. I'm almost positive that it is
>1158 samples for each MP3 frame and 1024 for each AAC frame. The
>stream is not allowed to "switch it up" during the playback. How
>much time 1024 samples is depends on the framerate. This way you can
>know how much time has passed (although it will be "quantized" to the
>frame size).
No, that won't work because my feeder thread decodes frames in chunks
of 1 second of audio data. Thus, time calculated on the basis of how many
frames have been decoded will be pretty unprecise. I want to have
millisecond precision.
Any other suggestions? As I said, I already have a solution that works
and it is also pretty precise. I'm taking the time in the notification proc
on kAudioUnitRenderAction_PreRender, and then use this as the basis
for determining how long the audio has been playing. I'm just wondering
if there's a nicer solution, but if there isn't, I could also live with the current
one.
Andreas
_______________________________________________
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