Enable AI Denoiser
The AI Denoiser plugin can reduce noise in calls and minimize the impact of environmental noise on communication. It can effectively suppress keyboard sounds, collisions, and other noises during calls, making it particularly suitable for scenarios where transient noise is sensitive, such as in conference settings.
Prerequisites
1. For usage fee instructions, please see TRTC Edition Features and Pricing.
2. Supported browsers: Chrome 66+, Edge 79+, Safari 14.1+, Firefox 76+. To make the best use of AI Denoiser, it is recommended to use the latest version of Chrome browser.
Note
If there is background music in the microphone input, the denoising plugin may treat it as noise and eliminate it.
Implementation Process
Deploying Resources for Denoising
Dynamic loading of file dependencies: The AI Denoiser plugin relies on some files. To ensure that the browser can load and run these files properly, you need to complete the following steps:
Publish the
denoiser-wasm.js
file from the node_modules/trtc-sdk-v5/plugins/ai-denoiser
directory to a CDN or a static resource server, and it should be in the same public path. If you need to use the denoising feature, you need to pass the URL of the above public path, and the plugin will dynamically load the dependent files.
If the Host URL of the files in the directory is different from the Host URL of the web application, you need to enable CORS policy for accessing the file domain.Do not place the directory files under an HTTP service, as loading HTTP resources under an HTTPS domain will be blocked by the browser's security policy.
Enable Denoising
await trtc.startLocalAudio();await trtc.startPlugin('AIDenoiser', {assetsPath: 'XXXXX/assets/', // For example: the denoiser-wasm.js file is stored in the assets directorysdkAppId: 123456,userId: 'user_123',userSig: 'XXXXXXXX'});
Disable Denoising
await trtc.stopPlugin('AIDenoiser');
API Description
trtc.startPlugin('AIDenoiser', options)
Used to enable denoising.
options
Name | Type | Attributes |
assetsPath | string | The location where the denoiser-wasm.js file is stored, for example: if it is stored in the assets directory, pass 'XXXXX/assets/' |
sdkAppId | number | The sdkAppId of the current application |
userId | string | The userId of the current user |
userSig | string | The userSig of the current user |
await trtc.startLocalAudio();await trtc.startPlugin('AIDenoiser', {assetsPath: 'XXXXX/assets/', // For example: the denoiser-wasm.js file is stored in the assets directorysdkAppId: 123456,userId: 'user_123',userSig: 'XXXXXXXX'});
trtc.stopPlugin('AIDenoiser')
Used to disable denoising.
await trtc.stopPlugin('AIDenoiser');