setRouteInCommunicationMode abstract method

Future<void> setRouteInCommunicationMode(
  1. int route
)

Selects the audio playback route in communication audio mode.

This method is used to switch the audio route from Bluetooth headphones to earpiece, wired headphones or speakers in communication audio mode (). After the method is called successfully, the SDK will trigger the onAudioRoutingChanged callback to report the modified route. This method is for Android only. Using this method and the setEnableSpeakerphone method at the same time may cause conflicts. Agora recommends that you use the setRouteInCommunicationMode method alone.

  • route The audio playback route you want to use: -1: The default audio route. 0: Headphones with microphone. 1: Handset. 2: Headphones without microphone. 3: Device's built-in speaker. 4: (Not supported yet) External speakers. 5: Bluetooth headphones. 6: USB device.

Returns Without practical meaning.

Implementation

Future<void> setRouteInCommunicationMode(int route);