For AI agents: see the complete documentation index at /llms.txt.
AI Noise Suppression
Updated
Suppress hundreds of types of noise and reduce distortion for human voice
AI Noise Suppression enables you to suppress hundreds of types of noise and reduce distortion in human voices when multiple people speak at the same time. In use-cases such as online meetings, online chat rooms, video consultations with doctors, and online gaming, AI Noise Suppression makes virtual communication as smooth as face-to-face interaction.
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
// Noise reductions modes
// 0 -> Balance mode
// 1 -> Aggressive mode
// 2 -> Aggressive mode with low latency
int mode = 1;
// Set the mode for Audio AI Noise Suppression
int result = rtcEngine.setAINSMode(true, mode);// Noise reductions modes
// 0 -> Balance mode
// 1 -> Aggressive mode
// 2 -> Aggressive mode with low latency
val mode = 1
// Set the mode for Audio AI Noise Suppression
val result = rtcEngine.setAINSMode(true, mode)Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
API reference
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
// Set AINS mode to AINS_MODE_BALANCED (0)
// Set AINS mode to AINS_MODE_AGGRESSIVE (1)
// Set AINS mode to AINS_MODE_ULTRALOWLATENCY (2)
let result = agoraKit.setAINSMode(true, mode: 2)When AI Noise Suppression is enabled, if Video SDK detects that the device performance is not sufficient, it:
- Disables AI Noise Suppression
- Enables traditional noise reduction
- Throws the
WARN_APM_AINS_CLOSED(-1054) error code
Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
Minimum device requirements
- iOS iPhone 6S
- iPadOS
- iPad Pro (2nd generation)
- iPad mini (5th generation)
- iPad Air (3rd generation)
- macOS MacBook Pro 2015
API reference
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
// Set AINS mode to AINS_MODE_BALANCED (0)
// Set AINS mode to AINS_MODE_AGGRESSIVE (1)
// Set AINS mode to AINS_MODE_ULTRALOWLATENCY (2)
let result = agoraKit.setAINSMode(true, mode: 2)Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
API reference
Try out the online demo for AI noise suppression.
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
The following implementation steps apply to the latest version of the AI Noise Suppression extension. Refer to the extension release notes for details.
-
Integrate AI Noise Suppression into your app
The AI Noise Suppression extension (agora-extension-ai-denoiser) requires Web SDK v4.15.1 or later. In the root of your project, run the following command to install the extension. By default, this installs the latest version (v2.0.2):
npm install agora-extension-ai-denoiserTo install a specific extension version, use one of the following commands:
-
v2.0.2 — Adds background voice removal, which further isolates the target voice in noisy or multi-speaker scenarios.
npm install agora-extension-ai-denoiser@2.0.2 -
v2.0.1 — Supports low-latency mode and log-level configuration. If you need background voice removal, use v2.0.2.
npm install agora-extension-ai-denoiser@2.0.1
-
-
Import AI Noise Suppression
Add the following code to your .js file.
import {AIDenoiserExtension} from "agora-extension-ai-denoiser";- Dynamically load the Wasm dependencies
The AI Noise Suppression extension depends on a few Wasm files. To ensure that the browser can load and execute these files, do the following:
-
Publish the files located in the
node_modules/agora-extension-ai-denoiser/externaldirectory to the CDN or static resource server, and put them under one public path. In subsequent steps, you need to pass in the public path URL to create anAIDenoiserExtensioninstance. The extension then dynamically loads these files.- If the host URL of the Wasm files is not the same as that of the web application, enable the CORS policy.
- Do not put the Wasm files in an HTTP service, loading HTTP resources in the HTTPS domain is blocked by the browsers' security policy.
-
If you have enabled the Content Security Policy (CSP), because Wasm files are not allowed to load in Chrome and Edge by default, you need to configure the CSP as follows:
-
For versions later than Chrome 97 and Edge 97 (Chrome 97 and Edge 97 included): Add
'wasm-unsafe-eval'andblob:in thescript-srcoptions. For example:<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'wasm-unsafe-eval' blob:"> -
For versions earlier than Chrome 97 and Edge 97: Add
'unsafe-eval'andblob:in thescript-srcoptions.
-
-
Register the AI Noise Suppression extension
Call AgoraRTC.registerExtensions, and pass in the created AIDenoiserExtension instance. Optionally, listen for the callback reporting that the Wasm and JS files fail to load.
// Create an AIDenoiserExtension instance, and pass in the host URL of the Wasm files
const denoiser = new AIDenoiserExtension({assetsPath:'./external'});
// Check compatibility
if (!denoiser.checkCompatibility()) {
// The extension might not be supported in the current browser. You can stop executing further code logic
console.error("Does not support AI Denoiser!");
}
// Register the extension
AgoraRTC.registerExtensions([denoiser]);
// (Optional) Listen for the callback reporting that the Wasm files fail to load
denoiser.onloaderror = (e) => {
// If the Wasm files fail to load, you can disable the extension, for example:
// openDenoiserButton.enabled = false;
console.log(e);
}Best practice is to create one AIDenoiserExtension instance only.
- Create an
IAIDenoiserProcessorinstance
Call the createProcessor method to create a processor, and set whether to enable the extension by default. If you do not set the default state, the extension inherits the previous state.
// Create a processor
const processor = denoiser.createProcessor();
// Enable the extension by default
processor.enable();
// Disable the extension by default
// processor.disable();- Inject the extension to the audio processing pipeline
Call pipe and specify the processorDestination property.
// Create a local video track
const audioTrack = await AgoraRTC.createMicrophoneAudioTrack();
// Inject the extension to the audio processing pipeline
audioTrack.pipe(processor).pipe(audioTrack.processorDestination);
await processor.enable();- Enable or disable the extension
Call the enable or disable methods as needed.
() => {
if (processor.enabled) {
await processor.disable();
} else {
await processor.enable();
}
}-
Set the noise suppression mode and level
// Listen for the callback reporting that the noise suppression process takes too long processor.on("overload", async (elapsedTime) => { console.log("overload!!!"); // Switch to steady-state noise reduction mode, temporarily disable AI noise reduction. await processor.setMode("STATIONARY_NS"); // Completely disable AI noise reduction and use the browser's built-in noise reduction. // await processor.disable() }); -
Dump audio data
Best practice for logging is to dump audio data. This significantly improves the efficiency of troubleshooting. To do this, call the dump method and listen for the dump and dumpend events to dump the audio data during the noise suppression process.
processor.on("dump", (blob, name) => {
// Dump the audio data files generated during the noise suppression process to your local machine in .pcm format.
const objectURL = URL.createObjectURL(blob);
const tag = document.createElement("a");
tag.download = name;
tag.href = objectURL;
tag.click();
setTimeout(() => {URL.revokeObjectURL(objectURL);}, 0);
});
processor.on("dumpend", () => {
console.log("dump ended!!");
});
processor.dump();Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
- For a working example, check out the AI Denoiser web demo and the associated source code.
API reference
This section provides the API reference for the AI Denoiser extension.
IAIDenoiserExtension
checkCompatibility
Checks whether the current browser supports the AI Denoiser extension. The result returned by this method is for reference only.
checkCompatibility(): boolean;Since v1.1.0
createProcessor
Creates an IAIDenoiserProcessor instance.
createProcessor(): IAIDenoiserProcessor;setLogLevel
Sets the log level. For available log levels, see AIDenoiserLogLevel.
public setLogLevel(level: AIDenoiserLogLevel)Since v2.0.0
onloaderror
Callback for Wasm dependency file loading failures.
onloaderror?: (error: Error) => void;Deprecated since v2.0.0
IAIDenoiserProcessor
kind
The processor type, either video or audio.
get kind(): 'video' | 'audio';enabled
Whether the extension is enabled:
true: Enabled.false: Not enabled.
get enabled(): boolean;enable
Enables the AI denoising feature.
enable(): void | Promise<void>;disable
Disables the AI denoising feature.
disable(): void | Promise<void>;This method must be called after pipe.
setMode
Sets the denoising mode.
setMode(mode: AIDenoiserProcessorMode): Promise<void>;Since v1.1.0
You can call this method in the onoverload callback to switch to stationary noise suppression to reduce overhead. See AIDenoiserProcessorMode for details.
This method must be called after pipe.
setLevel
Sets the denoising intensity. See AIDenoiserProcessorLevel for details.
setLevel(level: AIDenoiserProcessorLevel): Promise<void>;Since v1.1.0
This method must be called after pipe.
setLatency
Sets the denoising latency level. See AIDenoiserProcessorLatency for details.
setLatency(latency: AIDenoiserProcessorLatency): Promise<void>;Since v2.0.0
This method must be called after pipe.
dump
Dumps audio data during the denoising process to help troubleshoot and analyze denoising issues.
dump(): void;This method must be called after pipe.
Calling this method triggers 9 dump events, returning audio data processed by the extension 30 seconds before and 60 seconds after the method call, for a total of 9 audio files (see audio file description). Then it triggers the dumpend event, indicating that the audio data dump has completed.
Audio file description
Each audio file is encoded in PCM format with a duration of 30 seconds. The filename contains the following information:
- The processing stage of the audio data, one of the following:
input: Audio data awaiting denoising.ns_out: Audio data after noise suppression.agc_out: Audio data after voice enhancement.
- Audio sample rate.
- Number of channels.
- Dump time: If the dump time is T (in seconds), the file contains audio data from the range [T-30, T].
Example audio filename: input_16000hz_1ch_0.pcm
Note
- If you disable AI denoising before the
dumpevent triggers 9 times, the dump process terminates immediately and triggers thedumpendevent. In this case, fewer than 9 audio data files are returned. - If the extension processes less than 30 seconds of audio, the corresponding audio file duration is also less than 30 seconds.
ondump
Callback for dumping audio data.
ondump?: (blob: Blob, name: string) => void;Deprecated since v2.0.0
This callback returns the following parameters:
blob: The audio data file.name: The name of the audio data file.
ondumpend
Callback indicating that audio data dumping has completed.
ondumpend?: () => void;Deprecated since v2.0.0
onoverload
Callback for when denoising processing takes too long.
onoverload?: (elapsedTime: number) => void;Deprecated since v2.0.0
Parameters
elapsedTime: The time (in milliseconds) the extension takes to process one audio frame. This value is for reference only; precision depends on the browser's timing accuracy. For example, Firefox has lower time precision.
on callbacks
Listens for events.
on(event: "pipeerror", listener: AIDenoiserProcessorPipeErrorCallback): void;
on(event: "overload", listener: AIDenoiserProcessorOverloadCallback): void;
on(event: "dump", listener: AIDenoiserProcessorDumpCallback): void;
on(event: "dumpend", listener: AIDenoiserProcessorDumpEndCallback): void;Since v2.0.0, the AI Denoiser extension listens for the following events using the on method:
pipeerror: Wasm dependency file loading failure event. Replaces theonloaderrorcallback.overload: Denoising processing takes too long event. Replaces theonoverloadcallback.dump: Audio data dump event. Replaces theondumpcallback.dumpend: Audio data dump completed event. Replaces theondumpendcallback.
Type definitions
AIDenoiserExtensionOptions
AI Denoiser extension initialization parameters.
export interface AIDenoiserExtensionOptions {
assetsPath: string
}Parameters
assetsPath: The URL path to the Wasm files required by the AI Denoiser extension. Do not include a trailing slash in the path, for example,./external.
The extension constructs the full path to the Wasm file based on assetsPath. If an incorrect path causes the Wasm file to fail loading, you receive a pipeerror event.
AIDenoiserProcessorMode
Denoising mode.
export enum AIDenoiserProcessorMode {
NSNG = "NSNG",
STATIONARY_NS = "STATIONARY_NS",
}Values
NSNG: Hybrid noise reduction. This mode suppresses both stationary and non-stationary noise types.STATIONARY_NS: Stationary noise suppression. This mode only suppresses stationary noise. Use this mode only when AI denoising processing takes too long.
AIDenoiserProcessorLevel
Denoising intensity.
export enum AIDenoiserProcessorLevel {
SOFT = "SOFT",
AGGRESSIVE = "AGGRESSIVE",
}Values
SOFT: (Recommended) Soft denoising.AGGRESSIVE: Aggressive denoising. Increasing the denoising intensity to aggressive increases the probability of damaging the voice signal.
AIDenoiserLogLevel
AI Denoiser extension log level.
export enum AIDenoiserLogLevel {
DEBUG = "DEBUG",
INFO = "INFO",
WARN = "WARN",
ERROR = "ERROR",
NONE = "NONE",
}Values
DEBUG: (0) Prints debug information, general information, warnings, and error logs.INFO: (1) Prints general information, warnings, and error logs.WARN: (2) Prints warnings and error logs.ERROR: (3) Prints error logs only.NONE: (4) Prints no logs.
AIDenoiserProcessorLatency
AI denoising latency level.
export enum AIDenoiserProcessorLatency {
LOW = "LOW",
FULL = "FULL",
}Values
LOW: Low latency mode (approximately 40 ms). In this mode, denoising performance is slightly reduced.FULL: High latency mode.
Considerations
Currently, AI Noise Suppression has the following limitations:
- If only some of the audio tracks on the current web page enable AI Noise Suppression, audio tracks that do not enable AI Noise Suppression could be affected. This is because AI Noise Suppression turns on AEC and AGC and turns off NS in the browser.
- Although AI Noise Suppression supports Safari v14.1 and greater, there are performance issues. Best practice is to not support Safari.
- AI Noise Suppression does not support browsers on mobile devices.
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
// Enable Audio AI Noise Suppression
bool enableAINS = true;
// Set the mode for Audio AI Noise Suppression
// Choose one of the available modes: AINS_MODE_BALANCED, AINS_MODE_AGGRESSIVE, AINS_MODE_ULTRALOWLATENCY
AUDIO_AINS_MODE mode = AINS_MODE_BALANCED;
int result = rtcEngine->setAINSMode(enableAINS, mode);Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
API reference
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
const enabled = true; // Enable or disable AINS
const result = rtcEngine.setAINSMode(enabled, AudioAinsMode.AinsModeUltralowlatency);
if (result === 0) {
// AINS mode set successfully
} else {
// Failed to enable AINS
}Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
API reference
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
const setAINSMode = () => {
try {
// Enable or disable AINS
const enabled = true;
// Choose the AINS mode based on your requirements
const mode = AgoraRtcEngine.AudioAinsMode.AINS_MODE_ULTRALOWLATENCY;
// Call setAINSMode method
const result = rtcEngine.setAINSMode(enabled, mode);
} catch (error) {
console.error('Error setting AINS mode:', error);
}
};Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
API reference
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call setAINSMode to enable the AI noise suppression feature, and select a noise suppression mode:
Future<void> enableNoiseSuppression() async {
// Enable or disable AINS
bool enabled = true;
// Choose the AINS mode based on your requirements
AudioAinsMode mode = AudioAinsMode.AINS_MODE_ULTRALOWLATENCY;
// Call setAINSMode method
await _engine.setAINSMode(enabled: enabled, mode: mode);
}Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
API reference
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
-
Configure the noise suppression extension
This code initializes the AI Noise Suppression extension, checks compatibility, and sets up a noise reduction processor for the local microphone track. It registers the extension, checks compatibility, and initializes the AI noise processor.
function AgoraExtensionComponent() { const extension = useRef(new AIDenoiserExtension({assetsPath:'./node_modules/agora-extension-ai-denoiser/external'})); const processor = useRef<IAIDenoiserProcessor>(); useEffect(() => { const initializeAIDenoiserProcessor = async () => { AgoraRTC.registerExtensions([extension.current]); if (!extension.current.checkCompatibility()) { console.error("Does not support AI Denoiser!"); return; } if (localMicrophoneTrack) { console.log("Initializing an ai noise processor..."); try { processor.current = extension.current.createProcessor(); localMicrophoneTrack.pipe(processor.current).pipe(localMicrophoneTrack.processorDestination); await processor.current.enable(); } catch (error) { console.error("Error applying noise reduction:", error); } } }; void initializeAIDenoiserProcessor(); return () => { const disableAIDenoiser = async () => { processor.current?.unpipe(); localMicrophoneTrack?.unpipe(); await processor.current?.disable(); }; void disableAIDenoiser(); }; }, [localMicrophoneTrack]); } -
Change the noise reduction mode
This function changes the noise reduction mode based on the provided mode.
const changeNoiseReductionMode = (mode: AIDenoiserProcessorMode) => { processor.current.setMode(mode) } -
Change the noise reduction level
This function changes the noise reduction level based on the provided level.
const changeNoiseReductionLevel = (level: AIDenoiserProcessorLevel) => { processor.current.setLevel(level) }
Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
AI Noise Suppression reduces the following types of noise:
- Television
- Kitchen
- Street, such as birds chirping, traffic, and subway sounds
- Machine, such as fans, air conditioners, vacuum cleaners, and copiers
- Office, such as keyboard and mouse clicks
- Household, such as doors opening, creaking chairs, crying babies, and house renovations
- Constant knocking
- Beeps and clapping
- Music
You can choose following noise reduction strategies:
- Default: Reduces noise to a comfortable level without distorting human voice.
- Custom: A more enhanced or customized noise reduction strategy for your business use-case. Contact support@agora.io for details.
Want to try out AI Noise Suppression? Use the online demo.
Understand the tech
In the pre-processing stage, AI Noise Suppression uses deep learning noise reduction algorithms to modify data in the extensions pipeline.
AI noise suppression
Prerequisites
Ensure that you have implemented the SDK quickstart in your project.
Enable AI Noise Suppression
This section shows you how to integrate AI Noise Suppression into your app.
Call SetAINSMode to enable AI Noise Suppression and select a noise suppression mode:
// Enable Audio AI Noise Suppression
bool enableAINS = true;
// Set the mode for Audio AI Noise Suppression
// Choose one of the available modes: AINS_MODE_BALANCED, AINS_MODE_AGGRESSIVE, AINS_MODE_ULTRALOWLATENCY
AUDIO_AINS_MODE mode = AUDIO_AINS_MODE.AINS_MODE_BALANCED;
int result = rtcEngine.SetAINSMode(enableAINS, mode);Reference
This section completes the information on this page, or points you to documentation that explains other aspects about this product.
