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 to play sound on specific audio device?
Forum Updated to NodeBB v4.3 + New Features

How to play sound on specific audio device?

Scheduled Pinned Locked Moved Solved General and Desktop
5 Posts 2 Posters 653 Views 2 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.
  • G Offline
    G Offline
    gkavrecic
    wrote on last edited by
    #1

    I need to play sounds on different audio devices on the machine.
    Currently, I use QSound, but it only works on current default audio device.

    I'm able to find info about available audio devices: QAudioDeviceInfo::availableDevices()
    Is it somehow possible to have two C++ objects (QSound like) and use them for different audio outputs?

    Kent-DorfmanK 1 Reply Last reply
    0
    • G gkavrecic

      I need to play sounds on different audio devices on the machine.
      Currently, I use QSound, but it only works on current default audio device.

      I'm able to find info about available audio devices: QAudioDeviceInfo::availableDevices()
      Is it somehow possible to have two C++ objects (QSound like) and use them for different audio outputs?

      Kent-DorfmanK Offline
      Kent-DorfmanK Offline
      Kent-Dorfman
      wrote on last edited by
      #2

      @gkavrecic said in How to play sound on specific audio device?:

      Is it somehow possible to have two C++ objects (QSound like) and use them for different audio outputs?

      Not through the QSound mechanism. QSound is very primitive, only sinking to the default sound device.

      I light my way forward with the fires of all the bridges I've burned behind me.

      G 1 Reply Last reply
      2
      • Kent-DorfmanK Kent-Dorfman

        @gkavrecic said in How to play sound on specific audio device?:

        Is it somehow possible to have two C++ objects (QSound like) and use them for different audio outputs?

        Not through the QSound mechanism. QSound is very primitive, only sinking to the default sound device.

        G Offline
        G Offline
        gkavrecic
        wrote on last edited by
        #3

        @Kent-Dorfman
        I'm aware of QSound limits.
        Looking for an alternative.

        1 Reply Last reply
        0
        • G Offline
          G Offline
          gkavrecic
          wrote on last edited by
          #4

          What about QMediaPlayer?
          It has the QMediaService, but this class is strongly advised to avoid in new code.

          I hardly believe that Qt has no approach to play a sound on a specific device.

          1 Reply Last reply
          0
          • G Offline
            G Offline
            gkavrecic
            wrote on last edited by gkavrecic
            #5

            If it helps to anyone, use QSoundEffect.
            Not sure in which version started to support this, but for sure does not support devices in 5.10, but does in 5.15

            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