AudioParam

js.html.audio.AudioParam (extern class)

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

Documentation AudioParam by Mozilla Contributors, licensed under CC-BY-SA 2.5.

See:

Instance Members

value: Float

Represents the parameter's current volume as a floating point value; initially set to the value of AudioParam.defaultValue. Though it can be set, any modifications happening while there are automation events scheduled — that is events scheduled using the methods of the AudioParam — are ignored, without raising any exception.


defaultValue: Float

Represents the initial volume of the attribute as defined by the specific AudioNode creating the AudioParam.


minValue: Float

Represents the minimum possible value for the parameter's nominal (effective) range.


maxValue: Float

Represents the maximum possible value for the parameter's nominal (effective) range.


setValueAtTime(value: Float, startTime: Float): AudioParam

Schedules an instant change to the value of the AudioParam at a precise time, as measured against AudioContext.currentTime. The new value is given by the value parameter.

Name Type
value Float
startTime Float
Returns
AudioParam

linearRampToValueAtTime(value: Float, endTime: Float): AudioParam

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.

Name Type
value Float
endTime Float
Returns
AudioParam

exponentialRampToValueAtTime(value: Float, endTime: Float): AudioParam

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.

Name Type
value Float
endTime Float
Returns
AudioParam

setTargetAtTime(target: Float, startTime: Float, timeConstant: Float): AudioParam

Schedules the start of a change to the value of the AudioParam. The change starts at the time specified in startTime and exponentially moves towards the value given by the target parameter. The exponential decay rate is defined by the timeConstant parameter, which is a time measured in seconds.

Name Type
target Float
startTime Float
timeConstant Float
Returns
AudioParam

setValueCurveAtTime(values: Array<Float>, startTime: Float, duration: Float): AudioParam

Schedules the values of the AudioParam to follow a set of values, defined by an array of floating-point numbers scaled to fit into the given interval, starting at a given start time and spanning a given duration of time.

Name Type
values Array<Float>
startTime Float
duration Float
Returns
AudioParam

cancelScheduledValues(startTime: Float): AudioParam

Cancels all scheduled future changes to the AudioParam.

Name Type
startTime Float
Returns
AudioParam