Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Not able to fetch metadata for the mp3 files



  • I am trying to categorise the songs based on Metadata fetched.
    I used the following functions 1)isMetaDataAvailable and
    2)metaData(QMediaMetaData::AlbumArtist).toString()

    to fetch the information. They always return true. Do u have any suggestion ?



  • meta_player is my media player objext
    Signal:
    connect(meta_player, SIGNAL(metaDataChanged()), SLOT(metadata_capture()));

    Code of capture:
    if((meta_player->isMetaDataAvailable()) &&( inc < file_list.length()))
    {
    qDebug() << "Meta info available"<<endl;
    QStringList list = meta_player->availableMetaData();
    qDebug() << " Meta Data ="<<list.count()<<endl;
    for(int i=0;i<list.count();i++){
    qDebug() << list.at(i) << " = "<< meta_player->metaData(list.at(i)).toString();
    }
    qDebug()<<"**********************************************************************************";
    inc++;
    qDebug()<<"After Icrement "<<inc;
    qDebug()<<"File Name"<<file_list.at(inc);
    meta_player->setMedia(QUrl::fromLocalFile(file_list.at(inc)));
    qDebug()<<"File Name"<<file_list.at(inc);
    }

    The Signal meta_player->setMedia(QUrl::fromLocalFile(file_list.at(inc))); is not emitted properly. For example when I add 6 songs i get met info for two songs. The result is ambiguous, its not constant.


Log in to reply