async function initVoiceFocus()

in src/providers/VoiceFocusProvider/index.tsx [178:197]


  async function initVoiceFocus(
    vfSpec: VoiceFocusSpec | undefined,
    options: VoiceFocusDeviceOptions | undefined,
    canceled: () => boolean,
    createMeetingResponse: JoinMeetingInfo | undefined
  ): Promise<void> {
    // Throw away the old one and reinitialize.
    voiceFocusDevice?.stop();
    if (voiceFocusTransformer) {
      VoiceFocusDeviceTransformer.destroyVoiceFocus(voiceFocusTransformer);
    }
    setVoiceFocusTransformer(null);
    setVoiceFocusDevice(null);
    createVoiceFocusDeviceTransformer(
      vfSpec,
      options,
      canceled,
      createMeetingResponse
    );
  }