AnalyserNode Class

A node that provides the time-domain and frequency-domain data of its input (https://webaudio.github.io/web-audio-api/#AnalyserNode). Its output is its input.

public sealed class AnalyserNode : AudioNode
Inheritance
AudioNode AnalyserNode

Constructors

NameDescription
AnalyserNode(BaseAudioContext, AnalyserOptions?)Creates an analyser.

AnalyserNode(BaseAudioContext, AnalyserOptions?)

AnalyserNode.cs

Creates an analyser.

public AnalyserNode(BaseAudioContext context, AnalyserOptions? options = null)

Parameters

context BaseAudioContext
options AnalyserOptions?

Exceptions

DomException
An option is out of its range (an IndexSizeError).

See also

Properties

NameDescription
FftSizeGets or sets the size of the FFT (a power of two from 32 to 32768).
FrequencyBinCountGets the number of frequency bins (half the FFT size).
MaxDecibelsGets or sets the maximum power in dB of the byte frequency data.
MinDecibelsGets or sets the minimum power in dB of the byte frequency data.
SmoothingTimeConstantGets or sets the smoothing over time of the frequency data, from 0 to 1.

Gets or sets the size of the FFT (a power of two from 32 to 32768).

public uint FftSize { get; set; }

Property value

uint

Exceptions

DomException
The value is not a power of two from 32 to 32768 (an IndexSizeError).

See also

FrequencyBinCount

AnalyserNode.cs

Gets the number of frequency bins (half the FFT size).

public uint FrequencyBinCount { get; }

MaxDecibels

AnalyserNode.cs

Gets or sets the maximum power in dB of the byte frequency data.

public double MaxDecibels { get; set; }

Property value

double

Exceptions

DomException
The value is not greater than AnalyserNode.MinDecibels (an IndexSizeError).

See also

MinDecibels

AnalyserNode.cs

Gets or sets the minimum power in dB of the byte frequency data.

public double MinDecibels { get; set; }

Property value

double

Exceptions

DomException
The value is not less than AnalyserNode.MaxDecibels (an IndexSizeError).

See also

SmoothingTimeConstant

AnalyserNode.cs

Gets or sets the smoothing over time of the frequency data, from 0 to 1.

public double SmoothingTimeConstant { get; set; }

Property value

double

Exceptions

DomException
The value is not between 0 and 1 (an IndexSizeError).

See also

Methods

NameDescription
GetByteFrequencyData(Span<byte>)Copies the current frequency data, scaled from AnalyserNode.MinDecibels to AnalyserNode.MaxDecibels, to an array of bytes (a Uint8Array).
GetByteTimeDomainData(Span<byte>)Copies the current time-domain data (down-mixed to mono), scaled from -1 to 1, to an array of bytes (a Uint8Array).
GetFloatFrequencyData(Span<byte>)Copies the current frequency data in dB to an array (a Float32Array).
GetFloatTimeDomainData(Span<byte>)Copies the current time-domain data (down-mixed to mono) to an array (a Float32Array).

GetByteFrequencyData(Span<byte>)

AnalyserNode.cs

Copies the current frequency data, scaled from AnalyserNode.MinDecibels to AnalyserNode.MaxDecibels, to an array of bytes (a Uint8Array).

public void GetByteFrequencyData(Span<byte> array)

GetByteTimeDomainData(Span<byte>)

AnalyserNode.cs

Copies the current time-domain data (down-mixed to mono), scaled from -1 to 1, to an array of bytes (a Uint8Array).

public void GetByteTimeDomainData(Span<byte> array)

GetFloatFrequencyData(Span<byte>)

AnalyserNode.cs

Copies the current frequency data in dB to an array (a Float32Array).

public void GetFloatFrequencyData(Span<byte> array)

GetFloatTimeDomainData(Span<byte>)

AnalyserNode.cs

Copies the current time-domain data (down-mixed to mono) to an array (a Float32Array).

public void GetFloatTimeDomainData(Span<byte> array)