Skip to content

Commit b58010f

Browse files
authored
update 5
1 parent 286c13b commit b58010f

File tree

1 file changed

+20
-11
lines changed
  • articles/communication-services/tutorials/audio-quality-enhancements/includes

1 file changed

+20
-11
lines changed

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

Lines changed: 20 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Key traits for echo cancelation:
3535
> **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.
3636
3737
> [!IMPORTANT]
38-
> **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 don'te that to use echo effects you must use latest 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.
38+
> **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 effects 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.
3939
4040
> [!NOTE]
4141
> - Browser support for utilizing audio noise suppression effects is available only on Chrome and Edge desktop browsers.
@@ -58,9 +58,9 @@ If you use the **public preview** of the Calling SDK, you must use the [beta ver
5858
## Enable Audio Effects you wish to use
5959
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.
6060

61+
6162
### Initialize the Audio Effects Feature
6263
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.
63-
6464
```js
6565
import { createAzureCommunicationCallingWithAudioEffects } from '@azure/communication-calling-effects';
6666

@@ -69,21 +69,20 @@ const callClient = createAzureCommunicationCallingWithAudioEffects();
6969
This wraps the standard CallClient with audio effects capabilities.
7070

7171
### Enable Noise Suppression
72+
The following code snippet shows an example on how to enable **noise suppression** from within the Webjs environment.
7273
```js
7374
const deviceManager = await callClient.getDeviceManager();
7475
await deviceManager.askDevicePermission({ audio: true });
7576

7677
const selectedMicrophone = (await deviceManager.getMicrophones())[0];
77-
7878
const audioEffects = await deviceManager.createAudioEffects(selectedMicrophone);
7979

8080
// Enable noise suppression
8181
await audioEffects.setFeature({ featureName: 'noiseSuppression', enabled: true });
8282
```
8383
### Enable Echo Cancellation
84+
The following code snippet shows an example on how to enable **echo cancellation** from within the Webjs environment.
8485
```js
85-
=========================================
86-
8786
import * as AzureCommunicationCallingSDK from '@azure/communication-calling';
8887
import { EchoCancellationEffect } from '@azure/communication-calling-effects';
8988

@@ -97,16 +96,27 @@ const localAudioStreamInCall = call.localAudioStreams[0];
9796
// Get the audio effects feature API from LocalAudioStream
9897
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
9998

100-
// We recommend that you check support for the effect in the current environment by using the isSupported method on the feature API. Remember that noise suppression is only supported on desktop browsers for Chrome and Edge.
99+
```
100+
### Validate that the current browser environment supports audio effects
101+
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.
102+
```js
103+
104+
const deepNoiseSuppression = new DeepNoiseSuppressionEffect();
105+
const echoCancellationEffect = new EchoCancellationEffect();
106+
101107
const isEchoCancellationSupported = await audioEffectsFeatureApi.isSupported(echoCancellationEffect);
102108
if (isEchoCancellationSupported) {
103109
console.log('Echo Cancellation is supported in the current browser environment');
104110
}
105-
```
106111

107-
## Bring it all together: Load and start noise suppression, echo cancelation on client initialization
112+
const isNoiseSuppressionSupported = await audioEffectsFeatureApi.isSupported(deepNoiseSuppression);
113+
if (isNoiseSuppressionSupported) {
114+
console.log('Noise Suppression is supported in the current browser environment');
115+
}
116+
```
108117

109-
To initiate a call with noise suppression 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.
118+
## Bring it all together: Load and start noise suppression and echo cancelation
119+
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.
110120

111121
```js
112122
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
@@ -131,8 +141,7 @@ await audioEffectsFeatureApi.startEffects({
131141
```
132142

133143
## Turn on noise suppression during an ongoing call
134-
135-
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.
144+
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` API.
136145

137146
```js
138147
// Create the noise suppression instance

0 commit comments

Comments
 (0)