Skip to content

Commit 5647dca

Browse files
authored
Merge pull request #302173 from sloanster/patch-39
Update web.md
2 parents 95635e3 + 9ff3155 commit 5647dca

File tree

2 files changed

+51
-27
lines changed
  • articles/communication-services

2 files changed

+51
-27
lines changed

articles/communication-services/toc.yml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -526,13 +526,13 @@ items:
526526
href: quickstarts/voice-video-calling/local-preview-mirroring.md
527527
- name: Optimize video placement on your web app
528528
href: quickstarts/voice-video-calling/optimizing-video-placement.md
529-
displayName: Optimal Video Count, OVC, dual pin
530-
- name: Simulcast
529+
displayName: Optimal Video Count, OVC, dual pin, 1080P
530+
- name: Understanding Simulcast
531531
href: concepts/voice-video-calling/simulcast.md
532-
displayName: diagnostics, diagnose, feedback, quality, reliability, users, call, quick, satisfaction, improve, issues
533-
- name: Enable audio noise suppression improvements
532+
displayName: diagnostics, diagnose, feedback, quality, reliability, users, call, quick, satisfaction, improve, issues, simulcast
533+
- name: Add audio quality improvements
534534
href: tutorials/audio-quality-enhancements/add-noise-supression.md
535-
displayName: noise suppression, audio quality, noise removal, background noise, deep noise, voice isolation
535+
displayName: noise suppression, audio quality, noise removal, background noise, deep noise, voice isolation, echo cancellation
536536
- name: Enable video background effects
537537
href: quickstarts/voice-video-calling/get-started-video-effects.md
538538
displayName: background blur, background replace, background replacement, frosted glass

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

Lines changed: 46 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,7 @@ Key traits for echo cancelation:
3232
## Use audio effects: Install the calling effects npm package
3333

3434
> [!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.
36-
37-
> 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.
38-
>
39-
> Current browser support for adding audio noise suppression effects is available only on Chrome and Microsoft Edge desktop browsers.
35+
> **Noise Suppression** features are available in GA WebJS SDK version `1.28.4` or later, alongside the Azure Communication Services Calling Effects SDK version GA `1.1.2` or later. Alternatively, if you opt to use the public preview version, Calling SDK versions `1.24.2-beta.1` and later also support noise suppression.
4036
4137
> [!IMPORTANT]
4238
> **Echo Cancellation** 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.
@@ -60,7 +56,30 @@ If you use the **public preview** of the Calling SDK, you must use the [beta ver
6056
```
6157

6258
## Enable Audio Effects you wish to use
63-
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.
59+
The following is a tree-structured representation of the AudioEffects interface:
60+
```
61+
AudioEffectsFeature
62+
├── Properties
63+
│ ├── activeEffects: ActiveAudioEffects (read-only)
64+
│ └── name: string (inherited from AudioStreamFeature)
65+
66+
├── Methods
67+
│ ├── isSupported(effect: "BrowserNoiseSuppression" | DeepNoiseSuppressionEffect): Promise<boolean>
68+
│ ├── startEffects(config: AudioEffectsStartConfig): Promise<void>
69+
│ ├── stopEffects(config: AudioEffectsStopConfig): Promise<void>
70+
│ ├── on(event: "effectsStarted" | "effectsStopped" | "effectsError", listener: AudioEffectsFeatureListener): void
71+
│ └── off(event: "effectsStarted" | "effectsStopped" | "effectsError", listener: AudioEffectsFeatureListener): void
72+
73+
└── Inherited Methods (from AudioStreamFeature)
74+
└── dispose(): void
75+
```
76+
Where
77+
- `activeEffects` gives you the currently running audio effects.
78+
- `isSupported` checks if a specific effect is available in the current environment.
79+
- `startEffects` and `stopEffects` control the activation of effects (noise suppression, echo cancellation)
80+
- `on`/`off` let you subscribe/unsubscribe to events
81+
82+
For more 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.
6483

6584

6685
### Initialize the Audio Effects Feature
@@ -89,10 +108,14 @@ audioEffectsFeatureApi.on('effectsStopped', (activeEffects: ActiveAudioEffects)
89108
console.log(`Current status audio effects: ${activeEffects}`);
90109
});
91110

92-
93111
audioEffectsFeatureApi.on('effectsError', (error: AudioEffectErrorPayload) => {
94112
console.log(`Error with audio effects: ${error.message}`);
95113
});
114+
115+
// Start Communication Services Noise Suppression
116+
await audioEffectsFeatureApi.startEffects({
117+
noiseSuppression: deepNoiseSuppression
118+
});
96119
```
97120
### Enable Echo Cancellation
98121
The following code snippet shows an example on how to enable **echo cancellation** from within the WebJS environment.
@@ -110,6 +133,11 @@ const localAudioStreamInCall = call.localAudioStreams[0];
110133
// Get the audio effects feature API from LocalAudioStream
111134
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
112135

136+
// Start Communication Services echo cancellation
137+
await audioEffectsFeatureApi.startEffects({
138+
echoCancellation: echoCancellationEffect
139+
});
140+
113141
```
114142
### Validate that the current browser environment supports audio effects
115143
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.
@@ -130,7 +158,7 @@ if (isNoiseSuppressionSupported) {
130158
```
131159

132160
## Bring it all together: Load and start noise suppression and echo cancelation
133-
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.
161+
To initiate a call with both **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.
134162

135163
```js
136164
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
@@ -216,7 +244,7 @@ await audioEffectsFeatureApi.stopEffects({
216244
```
217245

218246
## Check what audio effects are active
219-
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.
247+
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. See [here](/javascript/api/azure-communication-services/@azure/communication-calling/activeaudioeffects?view=azure-communication-services-js&preserve-view=true) for more details on the `activeEffects` interface.
220248

221249
```js
222250
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
@@ -227,20 +255,16 @@ const localAudioStreamInCall = call.localAudioStreams[0];
227255
// Get the audio effects feature API from LocalAudioStream
228256
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
229257

230-
// Subscribe to useful events that show audio effects status
231-
audioEffectsFeatureApi.on('effectsStarted', (activeEffects: ActiveAudioEffects) => {
232-
console.log(`Current status audio effects: ${activeEffects}`);
233-
});
234-
235-
236-
audioEffectsFeatureApi.on('effectsStopped', (activeEffects: ActiveAudioEffects) => {
237-
console.log(`Current status audio effects: ${activeEffects}`);
238-
});
258+
// Get the current active effects
259+
const activeAudioEffects = audioEffectsFeatureApi.activeEffects;
239260

240-
241-
audioEffectsFeatureApi.on('effectsError', (error: AudioEffectErrorPayload) => {
242-
console.log(`Error with audio effects: ${error.message}`);
243-
});
261+
if (activeAudioEffects.noiseSuppression === 'DeepNoiseSuppression') {
262+
// Deep Noise Suppression is currently active
263+
}
264+
if (activeAudioEffects.echoCancellation === 'EchoCancellation') {
265+
// Echo Cancellation is currently active
266+
}
267+
;
244268
```
245269
## Best Practices
246270
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:

0 commit comments

Comments
 (0)