|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
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 |
|
|
|
|
|
#2 |
|
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).
|
|
|
|
|
|
#3 |
|
Senior Member
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 |
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|