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
Property | Modifiers | Type | Description |
---|---|---|---|
channelCount | readonly | number | The number of channels in the audio stream |
channelCountMode | readonly | ChannelCountMode | How input and output channels are matched |
channelInterpretation | readonly | ChannelInterpretation | Describes how channel mixing is handled |
context | readonly | AudioContext | The AudioContext that was used to create this MicrophoneAudioNode |
numberOfInputs | readonly | number | How many inputs feed into this node. |
numberOfOutputs | readonly | number | How many outputs come out of this node. |
Methods
Method | Modifiers | Description |
---|---|---|
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
Parameter | Type | Description |
---|---|---|
type | string | |
callback | EventListenerOrEventListenerObject | null | |
options | boolean | 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
Parameter | Type | Description |
---|---|---|
destination | AudioNode | |
outputIndex | number | (Optional) |
inputIndex | number | (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
Parameter | Type | Description |
---|---|---|
destination | AudioParam | |
outputIndex | number | (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
Parameter | Type | Description |
---|---|---|
event | Event |
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
Parameter | Type | Description |
---|---|---|
type | string | |
callback | EventListenerOrEventListenerObject | null | |
options | boolean | EventListenerOptions | (Optional) |
Returns:
void
Updated 7 months ago