setEnableSpeakerphone abstract method

Future<void> setEnableSpeakerphone(
  1. bool speakerOn
)

Enables/Disables the audio route to the speakerphone.

For the default audio route in different scenarios, see. This method is for Android and iOS only.

  • speakerOn Sets whether to enable the speakerphone or earpiece: true : Enable device state monitoring. The audio route is the speakerphone. false : Disable device state monitoring. The audio route is the earpiece.

Returns When the method call succeeds, there is no return value; when fails, the AgoraRtcException exception is thrown. You need to catch the exception and handle it accordingly.

Implementation

Future<void> setEnableSpeakerphone(bool speakerOn);