Metadata from audio file



  • Hello, guys! Please help me I try get metadata from different audio files, but all time got empty string. In QML same situation. Thank you for attention!

        connect(m_pPlayer,SIGNAL(metaDataChanged(QString,QVariant)),this,SLOT(metaData(QString,QVariant)));
        connect(m_pPlayer,SIGNAL(metaDataChanged()),this,SLOT(metaDataChanged()));
    
    
    void metaData(QString key, QVariant value)
    {
        qDebug() << "Key : " << key;
        qDebug() << "Value : " << value.toString();
    }
    
    void metaDataChanged()
    {
        qDebug() << "Changed";
        if(m_pPlayer->isMetaDataAvailable())
        {
            qDebug() << "Available";
            qDebug() << m_pPlayer->metaData(QMediaMetaData::AlbumTitle).value<QString>();
        }
         qDebug() << m_pPlayer->metaData(QMediaMetaData::AlbumTitle).value<QString>();
    }
    

  • Lifetime Qt Champion

    Hi and welcome to devnet,

    Are you sure you have the metadata requested in your files ?

    What version of Qt on what OS are you running ?


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.