Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. How to play list of audio files in Qt 6.4 ?
Forum Updated to NodeBB v4.3 + New Features

How to play list of audio files in Qt 6.4 ?

Scheduled Pinned Locked Moved Unsolved Qt 6
4 Posts 2 Posters 1.4k Views
  • 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.
  • P Offline
    P Offline
    Parvathy2020
    wrote on last edited by Parvathy2020
    #1

    Hi, My application was using QMediaPlayer and QMediaPlaylist to play audio files.

    List of audio files need to be played together. QMediaPlaylist helped to do that.

    But now, when we are trying to upgrade to qt 6.4.Since QMediaPlaylist is not available in qt 6.x,
    I have replaced m_playlist->addMedia(QUrl::fromLocalFile(acuFile));
    with
    m_player->setSource(QUrl::fromLocalFile(acuFile));

    But , the issue is I have a list of audio files that should be played together. And now only the last set file is getting played.

    What is the correct way to play a list of audio files in Qt 6.x ?

    1 Reply Last reply
    0
    • JoeCFDJ Offline
      JoeCFDJ Offline
      JoeCFD
      wrote on last edited by JoeCFD
      #2

      @Parvathy2020 said in How to play list of audio files in Qt 6.4 ?:

      QMediaPlaylist

      The source code of QMediaPlaylist is here. You build it with you project.
      https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/qmediaplaylist.cpp?h=6.4
      https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/qmediaplaylist.h?h=6.4
      https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/qmediaplaylist_p.h?h=6.4

      P 1 Reply Last reply
      0
      • JoeCFDJ JoeCFD

        @Parvathy2020 said in How to play list of audio files in Qt 6.4 ?:

        QMediaPlaylist

        The source code of QMediaPlaylist is here. You build it with you project.
        https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/qmediaplaylist.cpp?h=6.4
        https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/qmediaplaylist.h?h=6.4
        https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/qmediaplaylist_p.h?h=6.4

        P Offline
        P Offline
        Parvathy2020
        wrote on last edited by
        #3

        @JoeCFD Hi, Thanks for your reply.

        I have added the above listed .cpp and header files in my project. But it is throwing many errors:

        /home/pbabu/code/tsdop/tsdop/tsdopmain/inc/qmediaplaylist_p.h:16: error: qplaylistfileparser_p.h: No such file or directory
        In file included from ../../tsdop/tsdopmain/src/qmediaplaylist.cpp:2:
        ../../tsdop/tsdopmain/inc/qmediaplaylist_p.h:16:10: fatal error: qplaylistfileparser_p.h: No such file or directory
        16 | #include "qplaylistfileparser_p.h"
        | ^~~~~~~~~~~~~~~~~~~~~~~~~


        /home/pbabu/code/tsdop/tsdop/tsdopmain/src/qmediaplaylist.cpp:433: error: ‘class QMediaPlaylistPrivate’ has no member named ‘parser’
        ../../tsdop/tsdopmain/src/qmediaplaylist.cpp: In member function ‘void QMediaPlaylist::load(QIODevice*, const char*)’:
        ../../tsdop/tsdopmain/src/qmediaplaylist.cpp:433:8: error: ‘class QMediaPlaylistPrivate’ has no member named ‘parser’
        433 | d->parser->start(device, QString::fromUtf8(format));
        | ^~~~~~

        Will these 3 files alone enough for the successful build?

        Is there any other way to get this work ?

        1 Reply Last reply
        0
        • JoeCFDJ Offline
          JoeCFDJ Offline
          JoeCFD
          wrote on last edited by JoeCFD
          #4

          https://code.qt.io/cgit/qt/qtmultimedia.git/tree/examples/multimedia/player/player.pro?h=6.4
          you do need more which are there.

          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