Skip to content

Commit 15d33e9

Browse files
authored
Merge pull request #301984 from sloanster/patch-37
Update web.md
2 parents 7d70a64 + 6789c80 commit 15d33e9

File tree

1 file changed

+138
-48
lines changed
  • articles/communication-services/tutorials/audio-quality-enhancements/includes

1 file changed

+138
-48
lines changed

articles/communication-services/tutorials/audio-quality-enhancements/includes/web.md

Lines changed: 138 additions & 48 deletions
Original file line numberDiff line numberDiff line change
@@ -6,43 +6,67 @@ author: sloanster
66
ms.author: micahvivion
77

88
services: azure-communication-services
9-
ms.date: 06/27/2025
9+
ms.date: 06/28/2025
1010
ms.topic: include
1111
ms.service: azure-communication-services
1212
ms.subservice: calling
1313
---
1414

15-
The Azure Communication Services audio effects *noise suppression* abilities can improve your audio calls by filtering out unwanted background noises. Noise suppression is a technology that removes background noises from audio calls. Eliminating background noise makes it easier to talk and listen. Noise suppression can also reduce distractions and tiredness caused by noisy places. For example, if you're taking an Azure Communication Services WebJS call in a noisy coffee shop, turning on noise suppression can make the call experience better.
15+
The Azure Communication Services audio effects features can significantly enhance your audio calls by filtering out unwanted background noise and removing echo. Noise suppression works by identifying and eliminating distracting sounds like traffic, typing, or chatter, making conversations clearer and easier to follow. At the same time, echo removal ensures your voice doesn’t bounce back during the call, reducing feedback and preventing interruptions. These technologies not only improve speech clarity but also reduce listener fatigue—especially in noisy environments. For instance, if you're on an Azure Communication Services WebJS call in a busy coffee shop, enabling these audio effects can create a smoother, more focused communication experience.
16+
17+
## 🎧 What Are Audio Effects?
18+
Audio effects in ACS are real-time enhancements applied to microphone input during a call. The Azure Communications Services audio effects package has multiple abilities to remove unwanted sounds from a call (from a client perspective).
19+
20+
**Noise suppression** (sometimes called noise reduction) focuses on eliminating unwanted background sounds. Think typing sounds, fan hums, distant conversations, or street noise. Its job is to isolate your voice so that whoever is listening hears you more clearly, and reduce or remove the distracting background sounds. It uses algorithms trained to recognize the difference between your speech and ambient noise, then reduces or removes that noise in real time. These noises can be considered a sound that isn't human voice.
21+
Key traits that noise suppression enables:
22+
- Removes continuous or predictable background noises.
23+
- Enhances speech clarity.
24+
- Typically works on the speaker’s end before sending out the audio.
25+
26+
**Echo cancellation** removes echo caused when your microphone picks up audio from your speakers. For example, when someone is on speakerphone and their microphone picks up your voice from their speaker, it can loop back to you as an echo. Echo cancellation predicts and subtracts this returning sound so you don’t hear yourself talking back a fraction of a second later.
27+
Key traits for echo cancelation:
28+
- Reduces acoustic feedback.
29+
- Essential in open microphone and desktop setups where the microphone picks up audio output from a local speaker.
30+
- Reduces listener fatigue and confusion caused by hearing your own voice returned.
1631

1732
## Use audio effects: Install the calling effects npm package
1833

1934
> [!IMPORTANT]
35+
> **Noise Suppression** features are available in GA SDK version `1.28.4` or later, alongside the Azure Communication Services Calling Effects SDK version GA `1.1.2` or later. The general availability (GA) stable version `1.28.4` and later of the Calling SDK support noise suppression features. Alternatively, if you opt to use the public preview version, Calling SDK versions `1.24.2-beta.1` and later also support noise suppression.
2036
> This tutorial employs the Azure Communication Services Calling SDK version `1.28.4` or later, alongside the Azure Communication Services Calling Effects SDK version `1.1.2` or later. The general availability (GA) stable version `1.28.4` and later of the Calling SDK support noise suppression features. Alternatively, if you opt to use the public preview version, Calling SDK versions `1.24.2-beta.1` and later also support noise suppression.
2137
>
2238
> Current browser support for adding audio noise suppression effects is available only on Chrome and Microsoft Edge desktop browsers.
2339
24-
The calling effects library can't be used standalone. It works only when used with the Azure Communication Services Calling client library for WebJS.
40+
> [!IMPORTANT]
41+
> **Echo Cancelation** features are available in public preview SDK version [1.37.1](https://github.com/Azure/Communication/blob/master/releasenotes/acs-javascript-calling-library-release-notes.md#1371-beta1-2025-06-16). Also note that to use echo cancelation you must use public preview audio effects SDK version beta version [1.21.1-beta](https://www.npmjs.com/package/@azure/communication-calling-effects/v/1.2.1-beta.1) or later.
2542
26-
Use the `npm install` command to install the Azure Communication Services Audio Effects SDK for JavaScript.
43+
> [!NOTE]
44+
> - Utilizing audio effects is available only on Chrome and Edge desktop browsers.
45+
> - The audio effects library isn't a standalone module and can't function independently. To utilize its capabilities the effects package must be integrated with the Azure Communication Services Calling client library for WebJS.
46+
> - If you use the GA version of the Calling SDK, you must use the [GA version](https://www.npmjs.com/package/@azure/communication-calling-effects/v/latest) of the Calling audio effects package.
2747
28-
If you use the GA version of the Calling SDK, you must use the [GA version](https://www.npmjs.com/package/@azure/communication-calling-effects/v/latest) of the Calling Effects SDK.
48+
## Install the Audio Effects Package
49+
Use the `npm install` command to install the Azure Communication Services Audio Effects SDK for JavaScript.
2950

3051
```console
3152
@azure/communication-calling-effects/v/latest
3253
```
3354

34-
If you use the public preview of the Calling SDK, you must use the [beta version](https://www.npmjs.com/package/@azure/communication-calling-effects/v/next) of the Calling Effects SDK.
55+
If you use the **public preview** of the Calling SDK, you must use the [beta version](https://www.npmjs.com/package/@azure/communication-calling-effects/v/next) of the Calling Effects SDK. Use the `npm install` command to install the Azure Communication Services Audio Effects SDK for JavaScript.
3556

3657
```console
3758
@azure/communication-calling-effects/v/next
3859
```
3960

40-
## Load the noise suppression effects library
41-
61+
## Enable Audio Effects you wish to use
4262
For information on the interface that details audio effects properties and methods, see the [Audio Effects Feature interface](/javascript/api/azure-communication-services/@azure/communication-calling/audioeffectsfeature?view=azure-communication-services-js&preserve-view=true) API documentation page.
4363

44-
To use noise suppression audio effects within the Azure Communication Services Calling SDK, you need the `LocalAudioStream` property that's currently in the call. You need access to the `AudioEffects` API of the `LocalAudioStream` property to start and stop audio effects.
4564

65+
### Initialize the Audio Effects Feature
66+
To use audio effects within the Azure Communication Services Calling SDK, you need the `LocalAudioStream` property that's currently in the call. You need access to the `AudioEffects` API of the `LocalAudioStream` property to start and stop audio effects.
67+
68+
### Enable Noise Suppression
69+
The following code snippet shows an example on how to enable **noise suppression** from within the WebJS environment.
4670
```js
4771
import * as AzureCommunicationCallingSDK from '@azure/communication-calling';
4872
import { DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
@@ -69,66 +93,68 @@ audioEffectsFeatureApi.on('effectsError', (error: AudioEffectErrorPayload) => {
6993
console.log(`Error with audio effects: ${error.message}`);
7094
});
7195
```
96+
### Enable Echo Cancellation
97+
The following code snippet shows an example on how to enable **echo cancellation** from within the WebJS environment.
98+
```js
99+
import * as AzureCommunicationCallingSDK from '@azure/communication-calling';
100+
import { EchoCancellationEffect } from '@azure/communication-calling-effects';
72101

73-
## Check what audio effects are active
102+
// Create the noise suppression instance
103+
const echoCancellationEffect = new EchoCancellationEffect();
74104

75-
To check what noise suppression effects are currently active, you can use the `activeEffects` property.
105+
// Get LocalAudioStream from the localAudioStream collection on the call object
106+
// 'call' here represents the call object.
107+
const localAudioStreamInCall = call.localAudioStreams[0];
76108

77-
The `activeEffects` property returns an object with the names of the current active effects.
109+
// Get the audio effects feature API from LocalAudioStream
110+
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
78111

112+
```
113+
### Validate that the current browser environment supports audio effects
114+
We recommend that you check support for the effect in the current browser environment by using the `isSupported` method on the feature API. Remember that audio effects are only supported on desktop browsers for Chrome and Edge.
79115
```js
80-
// Use the audio effects feature API.
81-
const currentActiveEffects = audioEffectsFeatureApi.activeEffects;
82116

83-
// Create the noise suppression instance.
84117
const deepNoiseSuppression = new DeepNoiseSuppressionEffect();
85-
// We recommend that you check support for the effect in the current environment by using the isSupported API
86-
// method. Remember that noise suppression is only supported on desktop browsers for Chrome and Edge.
118+
const echoCancellationEffect = new EchoCancellationEffect();
87119

88-
const isDeepNoiseSuppressionSupported = await audioEffectsFeatureApi.isSupported(deepNoiseSuppression);
89-
if (isDeepNoiseSuppressionSupported) {
90-
console.log('Noise suppression is supported in local browser environment');
120+
const isEchoCancellationSupported = await audioEffectsFeatureApi.isSupported(echoCancellationEffect);
121+
if (isEchoCancellationSupported) {
122+
console.log('Echo Cancellation is supported in the current browser environment');
91123
}
92124

93-
// To start Communication Services Deep Noise Suppression
94-
await audioEffectsFeatureApi.startEffects({
95-
noiseSuppression: deepNoiseSuppression
96-
});
125+
const isNoiseSuppressionSupported = await audioEffectsFeatureApi.isSupported(deepNoiseSuppression);
126+
if (isNoiseSuppressionSupported) {
127+
console.log('Noise Suppression is supported in the current browser environment');
128+
}
129+
```
97130

98-
// To stop Communication Services Deep Noise Suppression
99-
await audioEffectsFeatureApi.stopEffects({
100-
noiseSuppression: true
101-
});
131+
## Bring it all together: Load and start noise suppression and echo cancelation
132+
To initiate a call with noise suppression and echo cancelation enabled, create a new `LocalAudioStream` property using `AudioDeviceInfo`. Ensure that the `LocalAudioStream` source isn't set as a raw `MediaStream` property to support audio effects. Then, include this property within `CallStartOptions.audioOptions` when starting the call.
102133

103-
```
134+
```js
135+
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
104136

105-
## Start a call with noise suppression automatically enabled
137+
// Create the noise suppression instance
138+
const deepNoiseSuppression = new DeepNoiseSuppressionEffect();
139+
// Create the noise suppression instance
140+
const echoCancellationEffect = new EchoCancellationEffect();
106141

107-
You can start a call with noise suppression turned on. Create a new `LocalAudioStream` property with `AudioDeviceInfo` (the `LocalAudioStream` source *shouldn't* be a raw `MediaStream` property to use audio effects), and pass it in `CallStartOptions.audioOptions`:
142+
// Get LocalAudioStream from the localAudioStream collection on the call object
143+
// 'call' here represents the call object.
144+
const localAudioStreamInCall = call.localAudioStreams[0];
108145

109-
```js
110-
// As an example, here we're simply creating LocalAudioStream by using the current selected mic on DeviceManager.
111-
const audioDevice = deviceManager.selectedMicrophone;
112-
const localAudioStreamWithEffects = new AzureCommunicationCallingSDK.LocalAudioStream(audioDevice);
113-
const audioEffectsFeatureApi = localAudioStreamWithEffects.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
146+
// Get the audio effects feature API from LocalAudioStream
147+
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
114148

115-
// Start effect
149+
// To start Communication Services Deep Noise Suppression
116150
await audioEffectsFeatureApi.startEffects({
151+
echoCancellation: echoCancellationEffect,
117152
noiseSuppression: deepNoiseSuppression
118-
});
119-
120-
// Pass LocalAudioStream in audioOptions in call start/accept options.
121-
await call.startCall({
122-
audioOptions: {
123-
muted: false,
124-
localAudioStreams: [localAudioStreamWithEffects]
125-
}
126-
});
153+
});
127154
```
128155

129156
## Turn on noise suppression during an ongoing call
130-
131-
You might start a call and not have noise suppression turned on. The environment might get noisy so that you need to turn on noise suppression. To turn on noise suppression, you can use the `audioEffectsFeatureApi.startEffects` API.
157+
You might start a call and not have noise suppression turned on. The end users room might get noisy so that they would need to turn on noise suppression. To turn on noise suppression, you can use the `audioEffectsFeatureApi.startEffects` interface.
132158

133159
```js
134160
// Create the noise suppression instance
@@ -157,6 +183,70 @@ await audioEffectsFeatureApi.stopEffects({
157183
noiseSuppression: true
158184
});
159185
```
186+
### To start or stop audio effects packages during an active call
187+
You might start a call and not have noise suppression turned on. The end users room might get noisy so that they would need to turn on noise suppression. To turn on noise suppression, you can use the `audioEffectsFeatureApi.startEffects` AP
188+
189+
#### To start Azure Communication Services Noise Suppression
190+
```js
191+
await audioEffectsFeatureApi.startEffects({
192+
noiseSuppression: deepNoiseSuppression
193+
});
194+
```
195+
196+
#### To stop Azure Communication Services Deep Noise Suppression
197+
```js
198+
await audioEffectsFeatureApi.stopEffects({
199+
noiseSuppression: true
200+
});
201+
```
202+
203+
#### To start Azure Communication Services echo cancelation
204+
```js
205+
await audioEffectsFeatureApi.startEffects({
206+
noiseSuppression: echoCancellation
207+
});
208+
```
209+
210+
#### To stop Azure Communication Services echo cancelation
211+
```js
212+
await audioEffectsFeatureApi.stopEffects({
213+
echoCancellation: true
214+
});
215+
```
216+
217+
## Check what audio effects are active
218+
To check what noise suppression effects are currently active, you can use the `activeEffects` property. The `activeEffects` property returns an object with the names of the current active effects.
219+
220+
```js
221+
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
222+
// Get LocalAudioStream from the localAudioStream collection on the call object.
223+
// 'call' here represents the call object.
224+
const localAudioStreamInCall = call.localAudioStreams[0];
225+
226+
// Get the audio effects feature API from LocalAudioStream
227+
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
228+
229+
// Subscribe to useful events that show audio effects status
230+
audioEffectsFeatureApi.on('effectsStarted', (activeEffects: ActiveAudioEffects) => {
231+
console.log(`Current status audio effects: ${activeEffects}`);
232+
});
233+
234+
235+
audioEffectsFeatureApi.on('effectsStopped', (activeEffects: ActiveAudioEffects) => {
236+
console.log(`Current status audio effects: ${activeEffects}`);
237+
});
238+
239+
240+
audioEffectsFeatureApi.on('effectsError', (error: AudioEffectErrorPayload) => {
241+
console.log(`Error with audio effects: ${error.message}`);
242+
});
243+
```
244+
## Best Practices
245+
The Azure Communication Services WebJS audio effects package provides tools for reducing unwanted sounds. Other measures can be taken to improve audio quality, such as:
246+
- Encouraging end users to consider using headphones to minimize the need for echo cancellation.
247+
- Enabling noise suppression tin shared or open work environments.
248+
- Setting noise suppression as the default option (i.e., having audio effects activated when a user initiates a call). If this feature is enabled automatically at the start of calls, users don't have to activate it manually. Enabling noise suppression and echo cancellation by default may help mitigate audio issues during calls.
249+
- Test audio effects in different environments to optimize end user experience.
160250

161251
## Related content
162252

0 commit comments

Comments
 (0)