Go Back   Winamp Forums > Developer Center > Winamp Development

Reply
Thread Tools Search this Thread Display Modes
Old 8th July 2002, 22:09   #1
yxdacdemic
Junior Member
 
Join Date: Jan 2002
Location: Chicago
Posts: 5
What's algorithm WinAmp use to caculate its time positions?

Hi,

I tested WinAmp time positions for VBR mp3 files. It seems there is a problem, the output time positions (in milliseconds) by using WM_USER Messages 105 are not accurate after a fast forward or rewind operation. I guess WinAmp may just simply get a current bit rate and use it to calculate a file length to seek. But I also realized that WinAmp can dynamically update its track length. It is the sign that WinAmp may average the bit rates for time estimations.

It is highly appreciated if somebody can give me some detailed guidelines about how WinAmp calculate its time position during fast forward or rewind operations? Thank you very much.

David
yxdacdemic is offline   Reply With Quote
Old 22nd July 2002, 17:57   #2
grv575
Junior Member
 
Join Date: Oct 2001
Posts: 7
If you load a 100mb mp3 you'll notice that it loads right away. This seems to indicate that winamp doesn't get exact times be running through all the frame headers and calculating the total play time. It most likely gets an estimate from either a small sample of frames or perhaps from the filesize. In any case this time is accurate enough to the second. Don't see why you would need or even want ms accuracy (since large files would then take too long to load).
grv575 is offline   Reply With Quote
Old 23rd July 2002, 00:28   #3
Gourou
Senior Member
 
Gourou's Avatar
 
Join Date: Feb 2002
Location: The backside of the universe on the trailing edge of eternity
Posts: 238
Vbr files have a certain frame rate already set, to wit:
a 128k vbr, can go down to 112k, or up to 160k, but it only does this momentarily, they can even go to greater extremes, but they still have a certain bitrate that they conform to, it is this bitrate that winamp calculates by. There is a chance I'm wrong, but I have written 2 decoders, and this is the method I used, when I calculate out the time, I was RARELY more than a 10th of a second off, and I could usually correct the display for this, before the user even heard one output sample
Gourou is offline   Reply With Quote
Reply
Go Back   Winamp Forums > Developer Center > Winamp Development

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump