[prev in list] [next in list] [prev in thread] [next in thread] 

List:       xaudio-sdk
Subject:    [xaudio-sdk] How to seek to an EXACT spot
From:       Ty Boyack <ty () nrel ! colostate ! edu>
Date:       2001-07-31 22:00:59
[Download RAW message or body]

Xaudioers,

I know that seeking withing an mp3 file has been covered in many
threads already, but I have not seen a good method offered to seek to
an exact point in the audio data. 

By exact, I mean that I would like to identify a single sample in the
decoded stream, and then be able to seek to a point in the input file,
decode enough frames to fill the bit reservior, decode the frames into
memory, and then pull out the sample from the decoded memory buffers.

It would work well in my application to pinpoint the sample by means
of an mp3 frame number and offset, but I can't find any way with the
xaudio API to seek to a given frame number.  Is there any way to have
the input module give out the byte position of the frames as it is
decoding them, so that I could then seek to a byte position?  Or has
anyone devised a way to seek to a given frame number?

I know that there are ways to estimate the byte offset in CBR files,
but this needs to work with VBR files as well.

Also, using the seek to time or timecode seems like it could get
close, but only plus or minus one frame length.  Is this true, or do
these seeking routines take into account the frame length and return a
partial frame?
To state this another way:  If frame 75 ended at 1.99 seconds, and
frame 76 ended at 2.01 seconds, what happens with a seek_to_time(*,2)
(seek to 2 seconds).  Will the decoder seek to 2.00, then skip to the
next frame and start decoding (with errored frames) at 2.01?  Or does
it internally back up enough to return a "partial" frame of the
decoded data from 2.00 to 2.01?

I'd appreciate any advice!

-Ty!

-- 
-===========================-
  Ty! Boyack
  NREL Unix Network Manager
  ty@nrel.colostate.edu
  (970) 491-1186
-===========================-

_______________________________________________
xaudio-sdk mailing list
xaudio-sdk@mpegtv.com
http://mailman.bok.net/mailman/listinfo/xaudio-sdk

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic