@@ -2,8 +2,7 @@ import React from 'react';
22import { Features , LocalAudioStream } from '@azure/communication-calling' ;
33import {
44 EchoCancellationEffect ,
5- DeepNoiseSuppressionEffect ,
6- VoiceIsolationEffect
5+ DeepNoiseSuppressionEffect
76} from '@azure/communication-calling-effects' ;
87import { 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 >
0 commit comments