Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Attributes of an Audio Files

    General and Desktop
    3
    7
    2495
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • U
      u2gilles last edited by

      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

      1 Reply Last reply Reply Quote 0
      • SGaist
        SGaist Lifetime Qt Champion last edited by

        Hi,

        You have to look at the multimedia module to get these informations

        Interested in AI ? www.idiap.ch
        Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

        1 Reply Last reply Reply Quote 0
        • clogwog
          clogwog last edited by

          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

          1 Reply Last reply Reply Quote 0
          • U
            u2gilles last edited by

            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();

            }
            @

            1 Reply Last reply Reply Quote 0
            • SGaist
              SGaist Lifetime Qt Champion last edited by

              IIRC you have to start playing the file before you can access the metadata

              Interested in AI ? www.idiap.ch
              Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

              1 Reply Last reply Reply Quote 0
              • U
                u2gilles last edited by

                It does not seem to be the case. I created a refresh button to use after starting playing but isMetaDataAvailable() still reply false.

                1 Reply Last reply Reply Quote 0
                • SGaist
                  SGaist Lifetime Qt Champion last edited by

                  Could you try the multimedia examples to see if they also suffer from the problem ?

                  Interested in AI ? www.idiap.ch
                  Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

                  1 Reply Last reply Reply Quote 0
                  • First post
                    Last post