@Axel-Spoerl What I want to achieve is: keep select the mac mini speaker in audio setting, my program has a build-in audio output menu and user can make selection in my program and the selection will only affect my program and not affect the system audio setting. To achieve this, I use QMediaDevices::audioOutputs to get all output device, then find the usb speaker, call setDevice to QAudioOutput and replay sound file, this works on window and Linux but not work on Mac. I mean the problem is calling setDevice not work, the sound still playing on Mac mini build-in speaker rather than my selection.
The quote "When I select the USB device for output, with qt or without qt, it's no problem playing sound." I mean my usb device has no problem, when I select usb device, the sound could play on it, but in this case, when I choose mac mini build-in speaker in my program, the sound still play on usb device. The problem is that QAudioOutput::setDevice not work, it does change the audio output device for QMediaPlayer.