Interface VoiceFocusTransformDeviceObserver

A device observer that is notified of lifecycle events on an Amazon Voice Focus device.

Use addObserver to register an observer with a device.

interface VoiceFocusTransformDeviceObserver {
    voiceFocusFellBackToInnerStream?: (
        device: VoiceFocusTransformDevice,
        e: Error,
    ) => void;
    voiceFocusInsufficientResources?: () => void;
}

Properties

voiceFocusFellBackToInnerStream?: (
    device: VoiceFocusTransformDevice,
    e: Error,
) => void

Called if application of Amazon Voice Focus to an inner device failed, and the VoiceFocusTransformDevice fell back to using the inner device directly.

Type declaration

voiceFocusInsufficientResources?: () => void

Called if noise suppression is unable to keep up with the audio stream. This can occur if:

  • You specified a model variant that is too complex for the compute environment.
  • The user is performing other actions on the device that are taking significant CPU.
  • You allowed estimation-based selection of model variant, and the environment at the time was less constrained than the normal runtime environment.

This method will be called after approximately 15ms of audio has been interrupted, and will be periodically called thereafter.

This method indicates that the user will be experiencing audio glitching, and your application should take action. This might include:

  • Disabling Amazon Voice Focus.
  • Disabling other features, e.g., limiting the number of video tiles.
  • Notifying the user.