setDefaultAudioRoute abstract method

Future<int?> setDefaultAudioRoute(
  1. AudioRoute audioRoute
)

Sets the speaker or earpiece as the default audio playback device.

Returned value:

  • 0: Success. The setting takes effect immediately. However, the audio route will not switch to the default device until all the audio peripheral devices are disconnected.
  • <0: Failure. It fails when the device designated is neither a speaker nor an earpiece.

Notes: For the default audio route switching strategy of the RTC SDK, see Set the Audio Route.

Implementation

Future<int?> setDefaultAudioRoute(AudioRoute audioRoute);