Context:
When using Vivox on Android with Bluetooth devices, the AudioManager
must be appropriately configured in order for audio capture to occur. If the AudioManager
is not updated, audio will be rendered through the Bluetooth device but not captured, and it will appear as if the local user is muted. An example of the necessary configuration code is shown in the following section.
Procedure:
Note: To prevent the Vivox SDK from unexpectedly changing AudioManager
settings, the Vivox library does not automatically perform this adjustment. The following must be performed in application code to speak over Bluetooth.
// The following code does not assume the code is running in
// the application context class.
AudioManager audioManager = (AudioManager)getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
audioManager.setBluetoothScoOn(true);
audioManager.startBluetoothSco();
For more information, see the official Android Developer documentation on AudioManager
: