import TRTCCloud, { TRTCAudioQuality } from 'trtc-electron-sdk';const rtcCloud = new TRTCCloud();function onSystemAudioLoopbackError(errCode) {if (errCode === 0) {console.log('Started successfully');}if (errCode === -1330) {console.log('Failed to enable system sound recording; for example, the audio driver plugin was unavailable');}if (errCode === -1331) {console.log('No permission to install the audio driver plugin');}if (errCode === -1332) {console.log('Failed to install the audio driver plugin');}}trtcCloud.on('onSystemAudioLoopbackError', onSystemAudioLoopbackError);trtcCloud.startLocalAudio(TRTCAudioQuality.TRTCAudioQualityDefault);trtcCloud.startSystemAudioLoopback();
startSystemAudioLoopback for the first time, the SDK will request root access. After being granted root access, the SDK will start installing the virtual sound card plugin to the computer automatically. trtcCloud.stopSystemAudioLoopback();
trtcCloud.setSystemAudioLoopbackVolume(60);
TRTCAudioPlugin.driver. For the plugin to work, you need to copy it to the system directory /Library/Audio/Plug-Ins/HAL and restart the audio service. You can check whether the plug is installed successfully using the Audio MIDI Setup app, which can be found in the Other folder of Launchpad. The presence of a device named "TRTC Audio Device" in the device list of the app indicates that the plugin is installed successfully. Feedback