Solved How to play sound on specific audio device?
-
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? -
@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.
-
@Kent-Dorfman
I'm aware of QSound limits.
Looking for an alternative. -
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.
-
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