Page 1 of 1

MP3 player example reports wrong songlength

Posted: Mon Nov 17, 2003 2:55 am
by bcgreen
Just an FYI-- the mp3 player example code that comes with PureBasic and that is also listed on the website returns an incorrect song length when you play mp3s...evidently you can use MCI to play mp3s, but not get the proper song length (at least, not using the method demonstrated in this code)...I'm assuming it has to do with the compression of mp3 audio data.

Also, if you are looking for the length of a wav file using MCI, rather than using the seek method in the code, simply call "status length" to get the audio file's length.

Bryan

Posted: Mon Nov 17, 2003 1:15 pm
by blueznl
mp3's are often vbr encoded in which case it is very hard to deduct length, the mci capabilities inside windows don't reach that far

Posted: Wed Nov 19, 2003 11:44 pm
by KarLKoX
I ve done a "somewhat" accurate mpeg header reader, it can handle vbr correctly and all weird mp3 i have, you can see the code here (based on foobar2000 and mpglib).