startSystemAudioLoopback abstract method

void startSystemAudioLoopback(
  1. {String? deviceName}
)

Enable system audio capturing (Only supports Windows)

This API captures audio data from the sound card of the anchor’s computer and mixes it into the current audio stream of the SDK. This ensures that other users in the room hear the audio played back by the anchor’s computer.

In online education scenarios, a teacher can use this API to have the SDK capture the audio of instructional videos and broadcast it to students in the room.

In live music scenarios, an anchor can use this API to have the SDK capture the music played back by his or her player so as to add background music to the room.

Parameters:

  • deviceName(String):
    • If this parameter is empty, the audio of the entire system is captured.

Note:

  • On the Windows platform, you can specify the parameter deviceName to the absolute path of an executable file (such as QQMusic.exe) of a certain application. In this case, the SDK will only capture the sound of that application (32-bit version of the SDK is supported, 64-bit version of the SDK requires Windows version 10.0.19042 or higher).
  • You can also specify deviceName as the name of a certain speaker device to capture specific speaker sound (you can use the getDevicesList interface in TXDeviceManager to obtain the speaker devices of type TXMediaDeviceType.speaker).
  • On the Windows platform, you can also specify deviceName as the process ID of a certain process (in the format of "process_xxx", where xxx is the process ID), and then the SDK will capture the sound of that process (requires Windows version 10.0.19042 or higher).
  • Alternatively, on the Windows platform, you can specify deviceName as the process ID of a certain process to be excluded (in the format of "exclude_process_xxx", where xxx is the process ID), and then the SDK will capture all sounds except for that process (requires Windows version 10.0.19042 or higher).
  • About speaker device name you can see TXDeviceManager .

Implementation

void startSystemAudioLoopback({String? deviceName});