sinch-rtc

# enableAutomaticAudioRouting

abstract fun enableAutomaticAudioRouting(audioRoutingConfig: AudioController.AudioRoutingConfig)

Enables automatic audio routing between earpiece, speakerphone, wired headset and bluetooth audio devices. Priorities are following:

1. Bluetooth (if available and AudioRoutingConfig.isBluetoothAudioManaged == true).

2. Wired Headset.

3. Default audio device if AudioRoutingConfig.useSpeakerphoneState is UseSpeakerphone.SPEAKERPHONE_TRUE or UseSpeakerphone.SPEAKERPHONE_FALSE, or Proximity sensor's based decision (speakerphone / earpiece) if AudioRoutingConfig.useSpeakerphoneState is UseSpeakerphone.SPEAKERPHONE_AUTO.

Default audio device (speakerphone/ earpiece) is set using AudioRoutingConfig.useSpeakerphoneState parameter.

#### Parameters

audioRoutingConfig

automatic routing configuration data.

#### See also

AudioController.AudioRoutingConfig

for more information about possible configuration.

#### Throws

MissingPermissionException

if AudioRoutingConfig.isBluetoothAudioManaged is set to true and android.Manifest.permission.BLUETOOTH or android.Manifest.permission.BLUETOOTH_CONNECT is not granted. This might be thrown only on devices running API below 31. On newer devices this functionality no longer requires any extra permissions. See https://developer.android.com/guide/topics/connectivity/bluetooth/permissions for more information how to handle bluetooth permissions.