Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

QT Android audio stream type



  • I am trying to use QAudioOutput and QAudioInput on an android device with a bluetooth headset. When switching the device to communication mode the microphone works, but the output produces no more sound. I am assuming this is related to the behavior described in the android documentation:

    startBluetoothSco()

    The issue seems to be QAudioOutput will use the STREAM_MUSIC by default. I'm unable to find how I may change this to STREAM_VOICE_CALL as per documentation.

    How to set the stream type for the audio?



  • Found the solution using setCategory(). It's unfortunate the category options are undocumented as they are platform specific. Entering a garbage category will cause a LogCat message showing the options: "alarm", "media", "notification", "ring", "system" and "voice".

    Using category "voice" makes QAudioOutput usable with bluetoothSCO.


Log in to reply