Emitted when the available set of Devices changes.
An array containing any Devices that were previously active that were lost as a result of this deviceChange event.
Emitted on requestAnimationFrame
(up to 60fps, depending on browser) with
the current input and output volumes, as a percentage of maximum
volume, between -100dB and -30dB. Represented by a floating point
number.
A floating point number between 0.0 and 1.0 inclusive.
A Map of all audio input devices currently available to the browser by their device ID.
A Map of all audio output devices currently available to the browser by their device ID.
False if the browser does not support HTMLAudioElement.setSinkId()
or
MediaDevices.enumerateDevices()
and Twilio cannot facilitate output selection functionality.
False if the browser does not support AudioContext and Twilio can not analyse the volume in real-time.
The current set of output devices that incoming ringtone audio is routed through. These are the sounds that may play while the user is away from the machine or not wearing their headset. It is important that this audio is heard. If all specified devices lost, this Set will revert to contain only the "default" device.
The current set of output devices that call audio ([voice, outgoing, disconnect, dtmf]
)
is routed through. These are the sounds that are initiated by the user, or played while
the user is otherwise present at the endpoint. If all specified devices are lost,
this Set will revert to contain only the "default" device.
The currently set audio constraints set by setAudioConstraints(). Starts as null.
The active input device. Having no inputDevice specified by setInputDevice()
will disable input selection related functionality.
The current input stream coming from the microphone device or the processed audio stream if there is an AudioProcessor.
The processed stream if an AudioProcessor was previously added.
Adds an AudioProcessor object. Once added, the AudioHelper will route the input audio stream through the processor before sending the audio stream to Twilio. Only one AudioProcessor can be added at this time.
See the AudioProcessor interface for an example.
The AudioProcessor to add.
Enable or disable the disconnect sound.
Passing true
will enable the sound and false
will disable the sound.
Not passing this parameter will not alter the enable-status of the sound.
The enable-status of the sound.
Enable or disable the incoming sound.
Passing true
will enable the sound and false
will disable the sound.
Not passing this parameter will not alter the enable-status of the sound.
The enable-status of the sound.
Enable or disable the outgoing sound.
Passing true
will enable the sound and false
will disable the sound.
Not passing this parameter will not alter the enable-status of the sound.
The enable-status of the sound.
Removes an AudioProcessor. Once removed, the AudioHelper will start using the audio stream from the selected input device for existing or future calls.
The AudioProcessor to remove.
Set the MediaTrackConstraints to be applied on every getUserMedia call for new input device audio. Any deviceId specified here will be ignored. Instead, device IDs should be specified using {@link AudioHelper#setInputDevice}. The returned Promise resolves when the media is successfully reacquired, or immediately if no input device is set.
The MediaTrackConstraints to apply.
Replace the current input device with a new device by ID.
An ID of a device to replace the existing input device with.
Unset the MediaTrackConstraints to be applied on every getUserMedia call for new input device audio. The returned Promise resolves when the media is successfully reacquired, or immediately if no input device is set.
Unset the input device, stopping the tracks. This should only be called when not in a connection, and will not allow removal of the input device during a live call.
Generated using TypeDoc
Provides input and output audio-based functionality in one convenient class.