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.
a device promise. This will always resolve to either a VoiceFocusTransformDevice or undefined; it will never reject.
Return the computed configuration for this transformer.
Return whether this transformer is able to function in this environment. If not, calls to createTransformDevice` will pass through an unmodified device.
Given a spec and options, perform the configuration work that is ordinarily performed during creation of a transformer.
The computed configuration is not portable between devices or sessions, but is useful for 'moving' transformers between windows.
Pass the returned configuration as the third argument to a call to VoiceFocusDeviceTransformer.create with the matching spec.
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.
A definition of how you want Amazon Voice Focus to behave. See the declaration of {@link VoiceFocusSpec}` for details.
Additional named arguments, including logger
and preload
.
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.
An optional asset group and URL paths to use when fetching. You can pass
a complete VoiceFocusSpec
here for convenience, matching the signature of create
.
Additional named arguments, including logger
.
Generated using TypeDoc
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);