mozilla
Your Search Results

    AudioParam Redirect 1

    « Web Audio API

    This is an experimental technology
    Because this technology's specification has not stabilized, check the compatibility table for the proper prefixes to use in various browsers. Also note that the syntax and behavior of an experimental technology is subject to change in future versions of browsers as the spec changes.

    The AudioParam interface represents an audio-related parameter, like one of an AudioNode, it can be set to a specific value or a change in value can be scheduled to happen at a specific time and following a specific pattern.

    There are two kinds of AudioParam, a-rate and k-rate parameters:

    • An a-rate AudioParam takes the current audio parameter value for each sample-frame of the audio signal.
    • A k-rate AudioParam uses the same initial audio parameter value for the whole block processed, that is 128 sample-frames.

    Each AudioNode defines which of its parameters are a-rate or k-rate.

    Each AudioParam have a list of events, initially empty, that defines when and how values changes. When this list if not empty, changes using the AudioParam.value attributes are ignored. This list of events allows to schedule changes that have to happen at very precise times and using arbitrary timelime-based automation curves. The time used is the one defined by AudioContext.currentTime.

    Properties

    Inherits properties from its parent, AudioNode.

    AudioParam.value
    Represents the parameter current floating-point value. Initially it is set to the value of AudioParam.defaultValue. Though it can be set, any modification happening while there are automation events scheduled — that is events scheduled using the methods of the AudioParam — is ignored, without raising any exception.
    AudioParam.defaultValue Read only
    Represents the initial value of the attributes as defined by the specific AudioNode creating the AudioParam.

    Methods

    Inherits methods from its parent, AudioNode.

    AudioParam.setValueAtTime()
    Schedules a change of the value of the AudioParam at a precise time, startTime, as defined by AudioContext.currentTime. The new value is given by the value parameter.
    AudioParam.linearRampToValueAtTime()
    Schedules a change of 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 by the value parameter and reaches the new value at the time given by the endTime parameter.
    AudioParam.exponentialRampToValueAtTime()
    Schedules a change of 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 by the value parameter and reaches the new value at the time given by the endTime parameter.
    Exponential ramps are useful when changing frequencies or playback rates because of the way the human ear is working.
    AudioParam.setTargetAtTime()
    Schedules the start of a change of the value of the AudioParam. The change starts at the specified time, startTime and exponentially tend towards the value given by the target parameter. The exponential decay rate is defined by the timeConstant parameter. It is the time it takes a first-order linear continuous time-invariant system to reach the value 1 - 1/e (around 63.2%) given a step input response (transition from 0 to 1 value), that is the larger it is, the slower the transition will be.  This is useful for decay or release portions of envelopes.
    AudioParam.setValueCurveAtTime()
    Schedules the values of the AudioParam to follow a set of values, defined by the values Float32Array, scaled to fit in the given interval, starting at startTime and having a specific duration.
    AudioParam.cancelScheduledValues()
    Cancels all scheduled future changes of the AudioParam.

    Examples

     

    Specifications

    Specification Status Comment
    Web Audio API Working Draft  

    Browser compatibility

    Feature Chrome Firefox (Gecko) Internet Explorer Opera Safari (WebKit)
    Basic support (Yes)webkit Activated on Nightly only Not supported Not supported ?
    Feature Android Firefox Mobile (Gecko) IE Phone Opera Mobile Safari Mobile
    Basic support Not supported Activated on Nightly only Not supported Not supported ?

    See also

    • Using Web Audio

    Document Tags and Contributors

    Contributors to this page: Sheppy
    Last updated by: Sheppy,