setEnableSpeakerphone method

  1. @override
Future<void> setEnableSpeakerphone(
  1. bool enabled
)

Enables/Disables the audio playback route to the speakerphone.

This method sets whether the audio is routed to the speakerphone or earpiece. After calling this method, the SDK returns the RtcEngineEventHandler.audioRouteChanged callback to indicate the changes.

Note

Parameter enabled Sets whether to route the audio to the speakerphone or earpiece:

  • true: Route the audio to the speakerphone.
  • false: Route the audio to the earpiece. If the headset is plugged in, the audio is routed to the headset.

Implementation

@override
Future<void> setEnableSpeakerphone(bool enabled) {
  return _invokeMethod('setEnableSpeakerphone', {'enabled': enabled});
}