enableLoopbackRecording abstract method

Future<void> enableLoopbackRecording({
  1. required bool enabled,
  2. String? deviceName,
})

Enables loopback audio capturing.

If you enable loopback audio capturing, the output of the sound card is mixed into the audio stream sent to the other end. This method applies to the macOS and Windows only. macOS does not support loopback audio capture of the default sound card. If you need to use this function, use a virtual sound card and pass its name to the deviceName parameter. Agora recommends using AgoraALD as the virtual sound card for audio capturing. You can call this method either before or after joining a channel. If you call the disableAudio method to disable the audio module, audio capturing will be disabled as well. If you need to enable audio capturing, call the enableAudio method to enable the audio module and then call the enableLoopbackRecording method.

  • enabled Sets whether to enable loopback audio capturing. true : Enable loopback audio capturing. false : (Default) Disable loopback audio capturing.
  • deviceName macOS: The device name of the virtual sound card. The default value is set to NULL, which means using AgoraALD for loopback audio capturing. Windows: The device name of the sound card. The default is set to NULL, which means the SDK uses the sound card of your device for loopback audio capturing.

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> enableLoopbackRecording(
    {required bool enabled, String? deviceName});