Analyzer
Extends
Properties
| Property | Modifier | Type |
|---|---|---|
fftSize | public | number |
frequencyBinCount | readonly | number |
maxDecibels | public | number |
minDecibels | public | number |
node | readonly | AnalyserNode |
smoothingTimeConstant | public | number |
Methods
connect()
Call Signature
connect(
destinationNode,
output?,
input?): AudioNode;
Parameters
| Parameter | Type |
|---|---|
destinationNode | AudioNode |
output? | number |
input? | number |
Returns
AudioNode
Inherited from
BaseAudioNode.connect
Call Signature
connect(destinationParam, output?): void;
Parameters
| Parameter | Type |
|---|---|
destinationParam | AudioParam |
output? | number |
Returns
void
Inherited from
BaseAudioNode.connect
disconnect()
Call Signature
disconnect(): void;
Returns
void
Inherited from
BaseAudioNode.disconnect
Call Signature
disconnect(output): void;
Parameters
| Parameter | Type |
|---|---|
output | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
Call Signature
disconnect(destinationNode): void;
Parameters
| Parameter | Type |
|---|---|
destinationNode | AudioNode |
Returns
void
Inherited from
BaseAudioNode.disconnect
Call Signature
disconnect(destinationNode, output): void;
Parameters
| Parameter | Type |
|---|---|
destinationNode | AudioNode |
output | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
Call Signature
disconnect(
destinationNode,
output,
input): void;
Parameters
| Parameter | Type |
|---|---|
destinationNode | AudioNode |
output | number |
input | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
Call Signature
disconnect(destinationParam): void;
Parameters
| Parameter | Type |
|---|---|
destinationParam | AudioParam |
Returns
void
Inherited from
BaseAudioNode.disconnect
Call Signature
disconnect(destinationParam, output): void;
Parameters
| Parameter | Type |
|---|---|
destinationParam | AudioParam |
output | number |
Returns
void
Inherited from
BaseAudioNode.disconnect
getAverageVolume()
getAverageVolume(buffer): number;
Utility function to get the average volume from getByteFrequencyData
Parameters
| Parameter | Type |
|---|---|
buffer | Float32Array |
Returns
number
Remarks
This is a better option when you only need to get the volume in terms of performance and complexity.
getByteFrequencyData()
getByteFrequencyData(buffer): void;
Copies the current frequency data into a Uint8Array (unsigned byte array) passed into it.
The frequency data is composed of integers on a scale from 0 to 255.
Parameters
| Parameter | Type | Description |
|---|---|---|
buffer | Uint8Array | Use provided buffer instead of creating a new one |
Returns
void
Remarks
The bytes versions are not cheaper than the float version but provided for convenient: the byte version are computed from the float version, using simple quantization to 2^8 values ref. https://padenot.github.io/web-audio-perf/#analysernode
getByteTimeDomainData()
getByteTimeDomainData(buffer): void;
Copies the current waveform, or time-domain, data into a Uint8Array (unsigned byte array) passed into it.
If the array has fewer elements than the AnalyserNode.fftSize, excess
elements are dropped.
If it has more elements than needed, excess elements are ignored.
Parameters
| Parameter | Type | Description |
|---|---|---|
buffer | Uint8Array | Use provided buffer instead of creating a new one |
Returns
void
Remarks
The bytes versions are not cheaper than the float version but provided for convenient: the byte version are computed from the float version, using simple quantization to 2^8 values ref. https://padenot.github.io/web-audio-perf/#analysernode
getFloatFrequencyData()
getFloatFrequencyData(buffer): void;
Copies the current waveform, or time-domain, data into Float32Array passed into it
Parameters
| Parameter | Type | Description |
|---|---|---|
buffer | Float32Array | Use provided buffer instead of creating a new one |
Returns
void
Remarks
The buffer size should be the same as AnalyserNode.frequencyBinCount
getFloatTimeDomainData()
getFloatTimeDomainData(buffer): void;
Copies the current waveform, or time-domain, data into Float32Array passed into it
Parameters
| Parameter | Type | Description |
|---|---|---|
buffer | Float32Array | Use provided buffer instead of creating a new one |
Returns
void
Remarks
The buffer size should be the same as AnalyserNode.fftSize