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:
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.
-
I'm trying to use QAudioInput and QAudioOutput with a bluetooth headset as well. My app works with QAudioOutput to the headset but wont use the bluetooth mic vie QAudioInput. Can you tell me what 'switching the device to communication mode' means? I am testing with an M98 heaset and Samsung S8 phone.