setPlaybackDevice abstract method
Specifies the playback device.
This method changes the current audio route but does not change the system default audio route. For example, if the system default audio route is Speaker 1, and you call this method to set the current audio route to Speaker 2 before joining a channel, the SDK will test Speaker 2 during device testing. After testing, when you join the channel, the SDK will still use the system default audio route, i.e., Speaker 1. This method is applicable to Windows and macOS only.
deviceIdSpecifies the playback device. Obtained via enumeratePlaybackDevices. Plugging or unplugging devices does not affect deviceId.
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. See Error Codes for details and resolution suggestions.
Implementation
Future<void> setPlaybackDevice(String deviceId);