setLoopbackDevice abstract method
Specifies the sound card capture device.
By default, the SDK uses the current playback device as the sound card capture device. To specify another audio device as the sound card capture device, call this method and set deviceId to the desired device. This method changes the current recording device but does not change the system default recording device. For example, if the system default recording device is Microphone 1, and you call this method to set the current audio route to Sound Card 1 before joining a channel, the SDK will test Sound Card 1 during device testing. After testing, when you join the channel, the SDK will still use the system default recording device, i.e., Microphone 1. This method is applicable to Windows and macOS only. Applicable scenarios: App A plays music through Bluetooth headset; App B conducts a video conference through speaker. If the sound card capture device is set to the Bluetooth headset, the SDK will publish the music from App A to the remote end. If the sound card capture device is set to the speaker, the SDK will not publish the music from App A. If you switch from Bluetooth headset to wired headset for App A after setting the sound card capture device to Bluetooth headset, you need to call this method again to set the sound card capture device to wired headset, so that the SDK continues publishing App A's music to the remote end.
deviceIdSpecifies the SDK's sound card capture device. Obtained via enumeratePlaybackDevices. Plugging or unplugging devices does not affect deviceId. Maximum length is MaxDeviceIdLengthType.
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> setLoopbackDevice(String deviceId);