Read Mpeg header in file without ID3v1

Marcelo Augusto maugusto.eu at gmail.com
Fri Sep 10 04:50:12 CEST 2010


Hello !
   I´m developing a cataloguer to put an order in my MP3 collection. I´m
using this code below to get the length of mp3 file as all other mpeg
details.
QString Filename = "/mnt/cd/file01.mp3";

TagLib::MPEG::File MpegFile(FileName.toStdString().c_str());
TagLib::MPEG::Properties MpegProperties(&MpegFile,
TagLib::AudioProperties::Accurate);
QString MyLength = "length: " + QString("%1").arg(MpegProperties.length());

  This works fine with almost my files, just when the mp3 file don´t have
ID3v1 (have only ID3v2) this code return "length: 0". I make tests using
EasyTag and manipulating the files to remove the ID3v1 and let just the
ID3v2 this happen in 100% of the cases.

  I have found a bug ? I´m not usually a lucky guy, then i ask for anyone to
help me why this happen in my code.

Some details:
I tried without the ReadStyle Accurate and the same result.
I tried too with bitrate, channels and this methods return 0 too.
I´m using the version 1.3.6 of the Taglib.
I´m developing using Qt 4.5.3 on Ubuntu 9.10.
I´m from Brazil and my english is not the best

Tanks everybody to this help.

-- 
.:.::Marcelo Augusto::.:.
MSN: harkonmoseley at hotmail.com
SKYPE: harkonmoseley
v3sw5CHUhw6ln6pr5FSP$u8Lw3XUl7RSDCK$e6t1b7Ta25s6MDr7!p hackerkey.com
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://mail.kde.org/pipermail/taglib-devel/attachments/20100909/c0eb75f6/attachment.htm 


More information about the taglib-devel mailing list