MicrophoneAudioNode class

Access the devices microphone as a node for the Web Audio API.

Signature:

export declare class MicrophoneAudioNode implements AudioNode 

Implements: AudioNode

Remarks

Use InputManager.getMicrophoneAudioNode() to get an instance of this class.

This is emulating the native API so support for some operations is limited. All properties are readonly, so mixing can not be controlled within this node.

The constructor for this class is marked as internal. Third-party code should not call the constructor directly or create subclasses that extend the MicrophoneAudioNode class.

Properties

PropertyModifiersTypeDescription
channelCountreadonlynumberThe number of channels in the audio stream
channelCountModereadonlyChannelCountModeHow input and output channels are matched
channelInterpretationreadonlyChannelInterpretationDescribes how channel mixing is handled
contextreadonlyAudioContextThe AudioContext that was used to create this MicrophoneAudioNode
numberOfInputsreadonlynumberHow many inputs feed into this node.
numberOfOutputsreadonlynumberHow many outputs come out of this node.

Methods

MethodModifiersDescription
addEventListener(type, callback, options)
connect(destination, outputIndex, inputIndex)Connect this microphone audio to another AudioNode for further processing.
connect(destination, outputIndex)Connect this microphone audio to another AudioParam for further processing.
disconnect()Disconnect all AudioNode that were connected to this one
dispatchEvent(event)
removeEventListener(type, callback, options)

MicrophoneAudioNode.channelCount property

The number of channels in the audio stream

Signature:

readonly channelCount: number;

MicrophoneAudioNode.addEventListener() method

Signature:

addEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | AddEventListenerOptions): void;

Parameters

ParameterTypeDescription
typestring
callbackEventListenerOrEventListenerObject | null
optionsboolean | AddEventListenerOptions(Optional)

Returns:

void

MicrophoneAudioNode.channelCountMode property

How input and output channels are matched

Signature:

readonly channelCountMode: ChannelCountMode;

MicrophoneAudioNode.channelInterpretation property

Describes how channel mixing is handled

Signature:

readonly channelInterpretation: ChannelInterpretation;

MicrophoneAudioNode.connect() method

Connect this microphone audio to another AudioNode for further processing.

Signature:

connect(destination: AudioNode, outputIndex?: number, inputIndex?: number): AudioNode;

Parameters

ParameterTypeDescription
destinationAudioNode
outputIndexnumber(Optional)
inputIndexnumber(Optional)

Returns:

AudioNode

Remarks

There will be a delay of up to a couple frames when modifying audio paths.

See AudioNode.connect for detailed usage

MicrophoneAudioNode.connect() method

Connect this microphone audio to another AudioParam for further processing.

Signature:

connect(destination: AudioParam, outputIndex?: number): void;

Parameters

ParameterTypeDescription
destinationAudioParam
outputIndexnumber(Optional)

Returns:

void

Remarks

There will be a delay of up to a couple frames when modifying audio paths.

See AudioNode.connect for detailed usage

MicrophoneAudioNode.context property

The AudioContext that was used to create this MicrophoneAudioNode

Signature:

readonly context: AudioContext;

MicrophoneAudioNode.disconnect() method

Disconnect all AudioNode that were connected to this one

Signature:

disconnect(): void;

Returns:

void

Remarks

There will be a delay of up to a couple frames when modifying audio paths

See AudioNode.disconnect for detailed usage, only the zero arg version of this function is supported

MicrophoneAudioNode.dispatchEvent() method

Signature:

dispatchEvent(event: Event): boolean;

Parameters

ParameterTypeDescription
eventEvent

Returns:

boolean

MicrophoneAudioNode.numberOfInputs property

How many inputs feed into this node.

Signature:

readonly numberOfInputs: number;

MicrophoneAudioNode.numberOfOutputs property

How many outputs come out of this node.

Signature:

readonly numberOfOutputs: number;

MicrophoneAudioNode.removeEventListener() method

Signature:

removeEventListener(type: string, callback: EventListenerOrEventListenerObject | null, options?: boolean | EventListenerOptions): void;

Parameters

ParameterTypeDescription
typestring
callbackEventListenerOrEventListenerObject | null
optionsboolean | EventListenerOptions(Optional)

Returns:

void