Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Attributes of an Audio Files
Forum Updated to NodeBB v4.3 + New Features

Attributes of an Audio Files

Scheduled Pinned Locked Moved General and Desktop
7 Posts 3 Posters 2.9k Views 1 Watching
  • 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 Offline
    U Offline
    u2gilles
    wrote on last edited by
    #1

    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
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      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
      0
      • clogwogC Offline
        clogwogC Offline
        clogwog
        wrote on last edited by
        #3

        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
        0
        • U Offline
          U Offline
          u2gilles
          wrote on last edited by
          #4

          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
          0
          • SGaistS Offline
            SGaistS Offline
            SGaist
            Lifetime Qt Champion
            wrote on last edited by
            #5

            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
            0
            • U Offline
              U Offline
              u2gilles
              wrote on last edited by
              #6

              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
              0
              • SGaistS Offline
                SGaistS Offline
                SGaist
                Lifetime Qt Champion
                wrote on last edited by
                #7

                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
                0

                • Login

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • Users
                • Groups
                • Search
                • Get Qt Extensions
                • Unsolved