Back to Content

DynamicsCompressorNode: threshold property

files/en-us/web/api/dynamicscompressornode/threshold/index.md

latest1.1 KB
Original Source

{{ APIRef("Web Audio API") }}

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

The threshold property's default value is -24 and it can be set between -100 and 0.

Value

An {{domxref("AudioParam")}}.

[!NOTE] Though the {{domxref("AudioParam")}} returned is read-only, the value it represents is not.

Examples

js
const audioCtx = new AudioContext();
const compressor = audioCtx.createDynamicsCompressor();
compressor.threshold.value = -50;

See BaseAudioContext.createDynamicsCompressor() for more complete example code.

Specifications

{{Specifications}}

Browser compatibility

{{Compat}}

See also