AudioParam

open class AudioParam(source)

The Web Audio API's AudioParam interface represents an audio-related parameter, usually a parameter of an AudioNode (such as GainNode.gain).

MDN Reference

Properties

Link copied to clipboard
Link copied to clipboard

The defaultValue read-only property of the AudioParam interface represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam.

Link copied to clipboard

The maxValue read-only property of the AudioParam interface represents the maximum possible value for the parameter's nominal (effective) range.

Link copied to clipboard

The minValue read-only property of the AudioParam interface represents the minimum possible value for the parameter's nominal (effective) range.

Link copied to clipboard

The value property of the AudioParam interface gets or sets the value of this AudioParam at the current time. Initially, the value is set to AudioParam.defaultValue.

Functions

Link copied to clipboard

The cancelAndHoldAtTime() method of the AudioParam interface cancels all scheduled future changes to the AudioParam but holds its value at a given time until further changes are made using other methods.

Link copied to clipboard

The cancelScheduledValues() method of the AudioParam Interface cancels all scheduled future changes to the AudioParam.

Link copied to clipboard

The exponentialRampToValueAtTime() method of the AudioParam Interface schedules a gradual exponential change in the value of the AudioParam. The change starts at the time specified for the previous event, follows an exponential ramp to the new value given in the value parameter, and reaches the new value at the time given in the endTime parameter.

Link copied to clipboard

The linearRampToValueAtTime() method of the AudioParam Interface schedules a gradual linear change in the value of the AudioParam. The change starts at the time specified for the previous event, follows a linear ramp to the new value given in the value parameter, and reaches the new value at the time given in the endTime parameter.

Link copied to clipboard
fun setTargetAtTime(target: Float, startTime: Double, timeConstant: Float): AudioParam

The setTargetAtTime() method of the AudioParam interface schedules the start of a gradual change to the AudioParam value. This is useful for decay or release portions of ADSR envelopes.

Link copied to clipboard
fun setValueAtTime(value: Float, startTime: Double): AudioParam

The setValueAtTime() method of the AudioParam interface schedules an instant change to the AudioParam value at a precise time, as measured against AudioContext.currentTime. The new value is given in the value parameter.

Link copied to clipboard
fun setValueCurveAtTime(values: Float32Array<*>, startTime: Double, duration: Double): AudioParam

fun setValueCurveAtTime(values: ReadonlyArray<JsDouble>, startTime: Double, duration: Double): AudioParam

The setValueCurveAtTime() method of the AudioParam interface schedules the parameter's value to change following a curve defined by a list of values.