Table of Contents

Class DynamicsCompressorNode

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The DynamicsCompressorNode interface provides a compression effect, which lowers the volume of the loudest parts of the signal in order to help prevent clipping and distortion that can occur when multiple sounds are played and multiplexed together at once. This is often used in musical production and game audio. DynamicsCompressorNode is an AudioNode that has exactly one input and one output.

[Value("DynamicsCompressorNode")]
public class DynamicsCompressorNode : AudioNode
Inheritance
DynamicsCompressorNode
Inherited Members

Remarks

Constructors

DynamicsCompressorNode()

public DynamicsCompressorNode()

DynamicsCompressorNode(BaseAudioContext, DynamicsCompressorOptions)

The DynamicsCompressorNode()
constructor creates a new DynamicsCompressorNode object which provides
a compression effect, which lowers the volume of the loudest parts of the
signal, in order to help prevent clipping and distortion. That can occur when
multiple sounds are played and multiplexed together at once.

public DynamicsCompressorNode(BaseAudioContext context, DynamicsCompressorOptions options = null)

Parameters

context BaseAudioContext
options DynamicsCompressorOptions

Remarks

Properties

Attack

The attack property of the DynamicsCompressorNode interface is a k-rate AudioParam representing the amount of time, in seconds, required to reduce the gain by 10 dB. It defines how quickly the signal is adapted when its volume is increased.

[Value("attack")]
public AudioParam Attack { get; }

Property Value

AudioParam

An AudioParam.

NOTE
Though the AudioParam returned is read-only, the value it represents is not.

Remarks

The attack property's default value is 0.003 and it can be set between 0 and 1.

-Using the Web Audio API

See also on MDN

Knee

The knee property of the DynamicsCompressorNode interface is a k-rate AudioParam containing a decibel value representing the range above the threshold where the curve smoothly transitions to the compressed portion.

[Value("knee")]
public AudioParam Knee { get; }

Property Value

AudioParam

An AudioParam.

NOTE
Though the AudioParam returned is read-only, the value it represents is not.

Remarks

Ratio

The ratio property of the DynamicsCompressorNode interface Is a k-rate AudioParam representing the amount of change, in dB, needed in the input for a 1 dB change in the output.

[Value("ratio")]
public AudioParam Ratio { get; }

Property Value

AudioParam

An AudioParam.

NOTE
Though the AudioParam returned is read-only, the value it represents is not.

Remarks

The ratio property's default value is 12 and it can be set between 1 and 20.

Describes the effect of different ratio on the output signal

-Using the Web Audio API

See also on MDN

Reduction

The reduction read-only property of the DynamicsCompressorNode interface is a float representing the amount of gain reduction currently applied by the compressor to the signal.

[Value("reduction")]
public Number Reduction { get; }

Property Value

Number

A float.

Remarks

Intended for metering purposes, it returns a value in dB, or 0 (no gain reduction) if no signal is fed into the DynamicsCompressorNode. The range of this value is between -20 and 0 (in dB).

-Using the Web Audio API

See also on MDN

Release

The release property of the DynamicsCompressorNode interface Is a k-rate AudioParam representing the amount of time, in seconds, required to increase the gain by 10 dB. It defines how quick the signal is adapted when its volume is reduced.

[Value("release")]
public AudioParam Release { get; }

Property Value

AudioParam

An AudioParam.

NOTE
Though the AudioParam returned is read-only, the value it represents is not.

Remarks

The release property's default value is 0.25 and it can be set between 0 and 1.

-Using the Web Audio API

See also on MDN

Threshold

The threshold property of the DynamicsCompressorNode interface is a k-rate AudioParam representing the decibel value above which the compression will start taking effect.

[Value("threshold")]
public AudioParam Threshold { get; }

Property Value

AudioParam

An AudioParam.

NOTE
Though the AudioParam returned is read-only, the value it represents is not.

Remarks