MP3 player example reports wrong songlength

Just starting out? Need help? Post your questions and find answers here.
bcgreen
User
User
Posts: 33
Joined: Sun Nov 02, 2003 7:33 am
Location: Pullman, WA

MP3 player example reports wrong songlength

Post 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
User avatar
blueznl
PureBasic Expert
PureBasic Expert
Posts: 6166
Joined: Sat May 17, 2003 11:31 am
Contact:

Post 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
( PB6.00 LTS Win11 x64 Asrock AB350 Pro4 Ryzen 5 3600 32GB GTX1060 6GB)
( The path to enlightenment and the PureBasic Survival Guide right here... )
KarLKoX
Enthusiast
Enthusiast
Posts: 681
Joined: Mon Oct 06, 2003 7:13 pm
Location: France
Contact:

Post 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).
"Qui baise trop bouffe un poil." P. Desproges

http://karlkox.blogspot.com/
Post Reply