Options
All
  • Public
  • Public/Protected
  • All
Menu

Class VoiceFocusDeviceTransformer

VoiceFocusDeviceTransformer is used to create transform devices that apply Amazon Voice Focus noise suppression to audio input.

This transformer captures relevant configuration. You should check for support, initialize, and then create a device as follows:

const deviceID = null;

// This check for support is cheap and quick, and should be used to gate use
// of this feature.
if (!(await VoiceFocusDeviceTransformer.isSupported()) {
  console.log('Amazon Voice Focus not supported in this browser.');
  return deviceID;
}

let transformer: VoiceFocusDeviceTransformer;
try {
  // This operation can fail in ways that do not indicate no support,
  // but do indicate an inability to apply Amazon Voice Focus. Trying again
  // might succeed.
  transformer = await VoiceFocusDeviceTransformer.create({});
} catch (e) {
  // Something went wrong.
  console.log('Unable to instantiate Amazon Voice Focus.');
  return deviceID;
}

if (!transformer.isSupported()) {
  // The transformer will fall through, but your UI might care.
  console.log('Amazon Voice Focus not supported in this browser.');
}

return await transformer.createTransformDevice(deviceID);

Hierarchy

  • VoiceFocusDeviceTransformer

Index

Methods

createTransformDevice

  • Apply Amazon Voice Focus to the selected Device.

    If this is a stream, it should be one that does not include other noise suppression features, and you should consider whether to disable automatic gain control (AGC) on the stream, because it can interact with noise suppression.

    Parameters

    • device: Device
    • Optional nodeOptions: NodeArguments

    Returns Promise<VoiceFocusTransformDevice>

    a device promise. This will always resolve to either a VoiceFocusTransformDevice or undefined; it will never reject.

getConfiguration

isSupported

  • isSupported(): boolean

Static configure

Static create

  • Create a transformer that can apply Amazon Voice Focus noise suppression to a device.

    This method will reject if the provided spec is invalid, or if the process of checking for support or estimating fails (e.g., because the network is unreachable).

    If Amazon Voice Focus is not supported on this device, this call will not reject and isSupported will return false on the returned instance. That instance will pass through devices unmodified.

    Parameters

    • spec: VoiceFocusSpec = {}

      A definition of how you want Amazon Voice Focus to behave. See the declaration of VoiceFocusSpec for details.

    • options: VoiceFocusDeviceOptions = {}

      Additional named arguments, including logger and preload.

    • Optional config: VoiceFocusConfig
    • Optional createMeetingResponse: any
    • Optional createAttendeeResponse: any

    Returns Promise<VoiceFocusDeviceTransformer>

Static destroyVoiceFocus

Static isSupported

  • Quickly check whether Amazon Voice Focus is supported on this platform.

    This will return false if key technologies are absent. A value of true does not necessarily mean that adding Amazon Voice Focus will succeed: it is still possible that the configuration of the page or the CPU speed of the device are limiting factors.

    VoiceFocusDeviceTransformer.create will return an instance whose isSupported method more accurately reflects whether Amazon Voice Focus is supported in the current environment.

    This method will only reject if you provide invalid inputs.

    Parameters

    • Optional spec: AssetSpec & { paths?: VoiceFocusPaths }

      An optional asset group and URL paths to use when fetching. You can pass a complete VoiceFocusSpec here for convenience, matching the signature of VoiceFocusDeviceTransformer.create.

    • Optional options: { allowIFrame?: boolean; logger?: Logger }

      Additional named arguments, including logger. Set allowIFrame to false to cause the support check to fail in an iframe. Chromium's security model means that audio processing works poorly in iframes.

      • Optional allowIFrame?: boolean
      • Optional logger?: Logger

    Returns Promise<boolean>

Generated using TypeDoc