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. How can we repeatedly playing an audio file with QAudioOutput?
Qt 6.11 is out! See what's new in the release blog

How can we repeatedly playing an audio file with QAudioOutput?

Scheduled Pinned Locked Moved Unsolved General and Desktop
6 Posts 3 Posters 1.6k 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.
  • D Offline
    D Offline
    DoHuuVi
    wrote on last edited by
    #1

    Can we repeatedly playing an audio file with QAudioOutput? I can play the file one time but cannot repeat. Are there somethings like aboutToFinish signal that I can use to seek the buffer to 0? So that QAudioOutput will play the file repeatedly.

    Thank you very much!

    raven-worxR 1 Reply Last reply
    0
    • D DoHuuVi

      Can we repeatedly playing an audio file with QAudioOutput? I can play the file one time but cannot repeat. Are there somethings like aboutToFinish signal that I can use to seek the buffer to 0? So that QAudioOutput will play the file repeatedly.

      Thank you very much!

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @DoHuuVi said:

      Are there somethings like aboutToFinish signal that I can use to seek the buffer to 0?

      When you at least would have looked at the docs once for the available signals you would have noticed that one of the 2 available signals is the stateChanged() signal...

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • D Offline
        D Offline
        DoHuuVi
        wrote on last edited by
        #3

        I want to reloop before the playing is stoped.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #4

          Hi,

          QAudioOutput is rather "low level". QMediaPlayer + QMediaPlayList might be more adapted to your use case.

          Hope it help

          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
          • D Offline
            D Offline
            DoHuuVi
            wrote on last edited by
            #5

            I want to play the file to a specific device/output so I think QAudioOutput is what we need. How can we specify the device/output with QMediaPlayer?

            1 Reply Last reply
            0
            • SGaistS Offline
              SGaistS Offline
              SGaist
              Lifetime Qt Champion
              wrote on last edited by
              #6

              You can try to query the QAudioOuputSelectorControl from QMediaPlayer.

              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