setAudioRoute abstract method
Designate the current audio playback device.
The default device is set through RTCVideo.setDefaultAudioRoute.
When the audio playback route changes, the local user will receive RTCVideoEventHandler.onAudioRouteChanged.
You can not set audioRoute
to Unknown
.
Return value:
0
: Success.<0
: Failure. See ReturnStatus for the reason.
Notes:
- This API is only supported in the
AUDIO_SCENARIO_COMMUNICATION
audio scenario. Call setAudioScenario to switch between different audio scenarios. - You can implement most scenarios by calling setDefaultAudioRoute and the default audio route switching strategy of the RTC SDK. For details about the strategy, see Set the Audio Route. You should use this API in a few exceptional scenarios like manually switching audio route with external audio device connected.
- For the volume type in different audio scenarios, see AudioScenario.
Implementation
Future<int?> setAudioRoute(AudioRoute audioRoute);