Examples
Fields
Client must allow browser to access their microphone / audioin source. Default: false. Will become true when the client enables access.
Input amplitude, connect to it by default but not to master out
Methods
Connect to an audio unit. If no parameter is provided, will
connect to the main output (i.e. your speakers).
Disconnect the AudioIn from all audio units. For example, if
connect() had been called, disconnect() will stop sending
signal to your speakers.
Read the Amplitude (volume level) of an AudioIn. The AudioIn
class contains its own instance of the Amplitude class to help
make it easy to get a microphone's volume level. Accepts an
optional smoothing value (0.0 < 1.0). NOTE: AudioIn must
.start() before using .getLevel().
Returns a list of available input sources. This is a wrapper for MediaDevices.enumerateDevices() - Web APIs | MDN and it returns a Promise.
Set the input source. Accepts a number representing a position in the array returned by getSources(). This is only available in browsers that support navigator.mediaDevices.enumerateDevices()