Skip to content

Commit 422479e

Browse files
Merge pull request #288 from Azure-Samples/yassirb/4444862
Rolled back VI surpport will be added later
2 parents d9cbd76 + 3a0f6b6 commit 422479e

3 files changed

Lines changed: 6 additions & 140 deletions

File tree

Project/src/MakeCall/AudioEffects/AudioEffectsContainer.js

Lines changed: 4 additions & 118 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ import React from 'react';
22
import { Features, LocalAudioStream } from '@azure/communication-calling';
33
import {
44
EchoCancellationEffect,
5-
DeepNoiseSuppressionEffect,
6-
VoiceIsolationEffect
5+
DeepNoiseSuppressionEffect
76
} from '@azure/communication-calling-effects';
87
import { Dropdown, PrimaryButton } from '@fluentui/react';
98

@@ -42,17 +41,10 @@ export default class AudioEffectsContainer extends React.Component {
4241
noiseSuppressionList: [],
4342
currentSelected: undefined
4443
},
45-
voiceIsolation: {
46-
startLoading: false,
47-
stopLoading: false,
48-
voiceIsolationList: [],
49-
currentSelected: undefined
50-
},
5144
activeEffects: {
5245
autoGainControl: [],
5346
echoCancellation: [],
54-
noiseSuppression: [],
55-
voiceIsolation: []
47+
noiseSuppression: []
5648
}
5749
};
5850

@@ -120,8 +112,7 @@ export default class AudioEffectsContainer extends React.Component {
120112
activeEffects: {
121113
autoGainControl: this.localAudioStreamFeatureApi?.activeEffects?.autoGainControl,
122114
echoCancellation: this.localAudioStreamFeatureApi?.activeEffects?.echoCancellation,
123-
noiseSuppression: this.localAudioStreamFeatureApi?.activeEffects?.noiseSuppression,
124-
voiceIsolation: this.localAudioStreamFeatureApi?.activeEffects?.voiceIsolation
115+
noiseSuppression: this.localAudioStreamFeatureApi?.activeEffects?.noiseSuppression
125116
}
126117
});
127118
}
@@ -132,7 +123,6 @@ export default class AudioEffectsContainer extends React.Component {
132123
const autoGainControlList = [];
133124
const echoCancellationList = [];
134125
const noiseSuppressionList = [];
135-
const voiceIsolationList = [];
136126

137127
if (this.localAudioStreamFeatureApi) {
138128
if (await this.localAudioStreamFeatureApi.isSupported('BrowserAutoGainControl')) {
@@ -177,15 +167,6 @@ export default class AudioEffectsContainer extends React.Component {
177167
});
178168
}
179169

180-
const voiceIsolation = new VoiceIsolationEffect();
181-
if (await this.localAudioStreamFeatureApi.isSupported(voiceIsolation)) {
182-
supported.push(voiceIsolation);
183-
voiceIsolationList.push({
184-
key: voiceIsolation.name,
185-
text: 'Voice Isolation'
186-
});
187-
}
188-
189170
this.setState({
190171
supportedAudioEffects: [ ...supported ],
191172
supportedAudioEffectsPopulated: true,
@@ -201,15 +182,10 @@ export default class AudioEffectsContainer extends React.Component {
201182
...this.state.noiseSuppression,
202183
noiseSuppressionList
203184
},
204-
voiceIsolation: {
205-
...this.state.voiceIsolation,
206-
voiceIsolationList
207-
},
208185
activeEffects: {
209186
autoGainControl: this.localAudioStreamFeatureApi?.activeEffects?.autoGainControl,
210187
echoCancellation: this.localAudioStreamFeatureApi?.activeEffects?.echoCancellation,
211-
noiseSuppression: this.localAudioStreamFeatureApi?.activeEffects?.noiseSuppression,
212-
voiceIsolation: this.localAudioStreamFeatureApi?.activeEffects?.voiceIsolation
188+
noiseSuppression: this.localAudioStreamFeatureApi?.activeEffects?.noiseSuppression
213189
}
214190
});
215191
}
@@ -401,64 +377,6 @@ export default class AudioEffectsContainer extends React.Component {
401377
}
402378
/* ------------ NS control functions - end ---------------- */
403379

404-
/* ------------ VI control functions - start ---------------- */
405-
viSelectionChanged(e, item) {
406-
const effect = this.findEffectFromSupportedList(item.key);
407-
if (effect) {
408-
this.setState({
409-
voiceIsolation: {
410-
...this.state.voiceIsolation,
411-
currentSelected: effect
412-
}
413-
});
414-
}
415-
}
416-
417-
async startVi() {
418-
this.setState({
419-
voiceIsolation: {
420-
...this.state.voiceIsolation,
421-
startLoading: true
422-
}
423-
});
424-
425-
if (this.localAudioStreamFeatureApi) {
426-
await this.localAudioStreamFeatureApi.startEffects({
427-
voiceIsolation: this.state.voiceIsolation.currentSelected
428-
});
429-
}
430-
431-
this.setState({
432-
voiceIsolation: {
433-
...this.state.voiceIsolation,
434-
startLoading: false
435-
}
436-
});
437-
}
438-
439-
async stopVi() {
440-
this.setState({
441-
voiceIsolation: {
442-
...this.state.voiceIsolation,
443-
stopLoading: true
444-
}
445-
});
446-
447-
if (this.localAudioStreamFeatureApi) {
448-
await this.localAudioStreamFeatureApi.stopEffects({
449-
voiceIsolation: true
450-
});
451-
}
452-
453-
this.setState({
454-
voiceIsolation: {
455-
...this.state.voiceIsolation,
456-
stopLoading: false
457-
}
458-
});
459-
}
460-
/* ------------ VI control functions - end ---------------- */
461-
462380
render() {
463381
return (
464382
<>
@@ -485,11 +403,6 @@ export default class AudioEffectsContainer extends React.Component {
485403
{this.state.activeEffects.noiseSuppression[0]}
486404
</div>
487405
}
488-
{this.state.activeEffects.voiceIsolation?.length > 0 &&
489-
<div className='ms-Grid-col ms-sm4 ms-md4 ms-lg4'>
490-
{this.state.activeEffects.voiceIsolation[0]}
491-
</div>
492-
}
493406
</div>
494407
<div className='ms-Grid-row'>
495408
<div className='ms-Grid-col ms-sm12 ms-md12 ms-lg12'>
@@ -571,33 +484,6 @@ export default class AudioEffectsContainer extends React.Component {
571484
</PrimaryButton>
572485
</div>
573486
</div>
574-
575-
<div className='ms-Grid-row'>
576-
<div className='ms-Grid-col ms-sm12 ms-md12 ms-lg12'>
577-
<Dropdown
578-
label='Voice Isolation'
579-
onChange={(e, item) => this.viSelectionChanged(e, item)}
580-
options={this.state.voiceIsolation.voiceIsolationList}
581-
placeholder={'Select an option'}
582-
styles={{ dropdown: { width: 300, color: 'black' }, label: { color: 'white' } }}
583-
/>
584-
</div>
585-
<div className='ms-Grid-col ms-sm12 ms-md12 ms-lg12'>
586-
<PrimaryButton
587-
className='secondary-button mt-2'
588-
onClick={() => this.startVi()}
589-
>
590-
{this.state.voiceIsolation.startLoading ? <LoadingSpinner /> : 'Start VI'}
591-
</PrimaryButton>
592-
593-
<PrimaryButton
594-
className='secondary-button mt-2'
595-
onClick={() => this.stopVi()}
596-
>
597-
{this.state.voiceIsolation.stopLoading ? <LoadingSpinner /> : 'Stop VI'}
598-
</PrimaryButton>
599-
</div>
600-
</div>
601487
</div>
602488
:
603489
<div>

Project/src/MakeCall/Login.js

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ export default class Login extends React.Component {
5050
isTeamsUser: false,
5151
isEntraUser: false,
5252
isJoinOnlyToken: false,
53-
headsetEnhancement: false,
5453
}
5554
}
5655

@@ -122,8 +121,7 @@ export default class Login extends React.Component {
122121
proxy: this.state.proxy,
123122
customTurn: this.state.customTurn,
124123
isTeamsUser: this.state.isTeamsUser,
125-
isEntraUser: this.state.isEntraUser,
126-
headsetEnhancement: this.state.headsetEnhancement
124+
isEntraUser: this.state.isEntraUser
127125
});
128126
}
129127
console.log('Login response: ', this.userDetailsResponse);
@@ -213,8 +211,7 @@ export default class Login extends React.Component {
213211
displayName: this.displayName,
214212
clientTag:this.clientTag,
215213
proxy: this.state.proxy,
216-
customTurn: this.state.customTurn,
217-
headsetEnhancement: this.state.headsetEnhancement
214+
customTurn: this.state.customTurn
218215
});
219216
this._callAgentInitPromise = new Promise((resolve) => { this._callAgentInitPromiseResolve = resolve });
220217
await this._callAgentInitPromise;
@@ -708,15 +705,6 @@ const isSupportedEnvironment = this.environmentInfo.isSupportedEnvironment;
708705
onChange={(e, isChecked) => this.setState({isJoinOnlyToken: isChecked})} />
709706
</div>
710707
</div>
711-
<div className="ms-Grid-row">
712-
<div className="ms-Grid-col">
713-
<Checkbox
714-
className='mt-3'
715-
label='Headset Enhancement'
716-
checked={this.state.headsetEnhancement}
717-
onChange={(e, isChecked) => this.setState({headsetEnhancement: isChecked})} />
718-
</div>
719-
</div>
720708
<div className="ms-Grid-row">
721709
<div className="ms-Grid-col">
722710
<PrimaryButton className="primary-button mt-3"

Project/src/MakeCall/MakeCall.js

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -84,7 +84,6 @@ export default class MakeCall extends React.Component {
8484
},
8585
preCallDiagnosticsResults: {},
8686
isTeamsUser: false,
87-
headsetEnhancement: false,
8887
identityMri: undefined,
8988
activeCallDetails: undefined
9089
};
@@ -132,10 +131,6 @@ export default class MakeCall extends React.Component {
132131
this.tokenCredential = tokenCredential;
133132
setLogLevel('verbose');
134133

135-
this.setState({ headsetEnhancement: userDetails.headsetEnhancement });
136-
137-
console.log("MakeCall::handleLogIn, headsetEnhancement: ", userDetails.headsetEnhancement);
138-
139134
const proxyConfiguration = userDetails.proxy.useProxy ? { url: userDetails.proxy.url } : undefined;
140135
const turnConfiguration = userDetails.customTurn.useCustomTurn ? userDetails.customTurn.turn : undefined;
141136
this.callClient = new CallClient({
@@ -148,9 +143,6 @@ export default class MakeCall extends React.Component {
148143
networkConfiguration: {
149144
proxy: proxyConfiguration,
150145
turn: turnConfiguration
151-
},
152-
audioOptions: {
153-
headsetEnhancement: userDetails.headsetEnhancement
154146
}
155147
});
156148

0 commit comments

Comments
 (0)