Attributes of an Audio Files
-
Hi, I would like retrieve information about mp3 files like "title" , "artist", "date creation" etc...
These attributes are not part of QFileInfo
Thanks for your help.
Gilles -
Hi,
You have to look at the multimedia module to get these informations
-
the keyword you are looking for is ID3 tags for mp3 files
http://qt-project.org/forums/viewthread/9022
http://harmattan-dev.nokia.com/docs/library/html/qt4/phonon-mediaobject.html#metaData -
Thanks SGalst, I just tried using multimedia module.
My mp3 file has a title and lots of properties but when i test isMetaDataAvailable() , it returns false and of course metaData("Title") does not return anything.
Am I using the wrong method and Class ? My goal is to retrieve existing properties , not to set mine.
Please find below an extract of the code :@
player = new QMediaPlayer;
player->setMedia(QUrl::fromLocalFile("D:/Test1/deux.mp3"));
player->setVolume(50);
qDebug() << "meta:" << player->isMetaDataAvailable();
ui->lineTitre->setText(player->metaData("Title").toString());
@Please note that the mp3 plays successfully below in my program :
@
void Widget::on_butStart_clicked()
{
player->play();}
@ -
IIRC you have to start playing the file before you can access the metadata
-
It does not seem to be the case. I created a refresh button to use after starting playing but isMetaDataAvailable() still reply false.
-
Could you try the multimedia examples to see if they also suffer from the problem ?