jumping to a certain sample within mp3 file II

<[email protected]> Fri, 27 Jan 2006 10:42:41 +0100
Newsgroups gmane.comp.audio.mad.devel
Message-ID <[email protected]>
Hi,

due to the feature of jumping to a certain sample number within a mp3 file:

My aim is to visualize the encoded Samples like it is done in Cool Edit and
other audio programmes.

So I have to find the new sample position to start reading from when the
user zooms in/out or uses a scrollbar to go forward or backward within the
visualization.

I do not want to uncompress the entire mp3 file at first (and store it
temporary as uncompressed PCM like Steinberg Wavelab does) when opening the
file.

Using uncompressed PCM you can calculate easily the new sample position
within the audio data.

As I have read a single mp3 frame plays 26ms of audio data. Using the
bitrate per second, bits per frame, filesize you can calculate the total
amount of frames and then step to frame number x and begin decoding the
samples.

So you step through your audio data by a factor of 26ms.
I wonder how the realplayer or mediaplayer get this job done.

Ciao, Michael

>>As I know, the mp3 file is organized in frame base which means it might
>>not jump to a specific sample number(if it is the original input,
>>compressed data). And the decoding process is much dependent upon the
>>integrity of the frame. 
>>
>>By the way,  I am also wondering what is the scenario it might be useful
>>about this feature?
>>
>>Best regards,
>>
>>Li xiaochao.Jeff
> ----------------------------------------------------------------------
> 
> Message: 1
> Date: Wed, 18 Jan 2006 20:39:37 +0100
> From: <[email protected]>
> Subject: [mad-dev] seeking, jumping to a certain position within mp3
> file
> To: <[email protected]>
> Message-ID: <[email protected]>
> Content-Type: text/plain; charset="us-ascii"
> 
> Hi,
> 
> does libmad provide the possibility to jump to a certain position within a
> mp3-file?
> 
> Is it possible to jump to a certain sample number (e.g. 44100, 88200)
within
> a mp3-file?