import type { VoiceFocusDelegate } from '../../libs/voicefocus/types' ; import VoiceFocusTransformDevice from './VoiceFocusTransformDevice' ; import VoiceFocusTransformDeviceObserver from './VoiceFocusTransformDeviceObserver' ; internal export default class VoiceFocusTransformDeviceDelegate implements VoiceFocusDelegate { private observers : Set < VoiceFocusTransformDeviceObserver > = new Set ( ) ; addObserver ( observer ) { this . observers . add ( observer ) ; } removeObserver ( observer ) { this . observers . delete ( observer ) ; } internal onFallback ( device , e ) { for ( const observer of this . observers ) { observer . voiceFocusFellBackToInnerStream ?. call ( observer , device , e ) ; } } onCPUWarning ( ) { for ( const observer of this . observers ) { observer . voiceFocusInsufficientResources ?. call ( observer ) ; } } }