Skip to content

Commit 3fc3c90

Browse files
authored
update 4
1 parent 4ded252 commit 3fc3c90

File tree

2 files changed

+26
-23
lines changed
  • articles/communication-services

2 files changed

+26
-23
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: 21 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,6 @@ Key traits for echo cancelation:
3939
4040
> [!NOTE]
4141
> - Utilizing audio effects is available only on Chrome and Edge desktop browsers.
42-
43-
> [!NOTE]
4442
> - 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.
4543
> - 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.
4644
@@ -87,10 +85,14 @@ audioEffectsFeatureApi.on('effectsStopped', (activeEffects: ActiveAudioEffects)
8785
console.log(`Current status audio effects: ${activeEffects}`);
8886
});
8987

90-
9188
audioEffectsFeatureApi.on('effectsError', (error: AudioEffectErrorPayload) => {
9289
console.log(`Error with audio effects: ${error.message}`);
9390
});
91+
92+
// Start Communication Services Noise Suppression
93+
await audioEffectsFeatureApi.startEffects({
94+
noiseSuppression: deepNoiseSuppression
95+
});
9496
```
9597
### Enable Echo Cancellation
9698
The following code snippet shows an example on how to enable **echo cancellation** from within the WebJS environment.
@@ -108,6 +110,11 @@ const localAudioStreamInCall = call.localAudioStreams[0];
108110
// Get the audio effects feature API from LocalAudioStream
109111
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
110112

113+
// Start Communication Services echo cancellation
114+
await audioEffectsFeatureApi.startEffects({
115+
echoCancellation: echoCancellationEffect
116+
});
117+
111118
```
112119
### Validate that the current browser environment supports audio effects
113120
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.
@@ -128,7 +135,7 @@ if (isNoiseSuppressionSupported) {
128135
```
129136

130137
## Bring it all together: Load and start noise suppression and echo cancelation
131-
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.
138+
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.
132139

133140
```js
134141
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
@@ -214,7 +221,7 @@ await audioEffectsFeatureApi.stopEffects({
214221
```
215222

216223
## Check what audio effects are active
217-
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.
224+
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) for more details on the 'activeEffects' interface.
218225

219226
```js
220227
import { EchoCancellationEffect, DeepNoiseSuppressionEffect } from '@azure/communication-calling-effects';
@@ -225,20 +232,16 @@ const localAudioStreamInCall = call.localAudioStreams[0];
225232
// Get the audio effects feature API from LocalAudioStream
226233
const audioEffectsFeatureApi = localAudioStreamInCall.feature(AzureCommunicationCallingSDK.Features.AudioEffects);
227234

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

238-
239-
audioEffectsFeatureApi.on('effectsError', (error: AudioEffectErrorPayload) => {
240-
console.log(`Error with audio effects: ${error.message}`);
241-
});
238+
if (activeAudioEffects.noiseSuppression === 'DeepNoiseSuppression') {
239+
// Deep Noise Suppression is currently active
240+
}
241+
if (activeAudioEffects.echoCancellation === 'EchoCancellation') {
242+
// Echo Cancellation is currently active
243+
}
244+
;
242245
```
243246
## Best Practices
244247
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)