PokéRogue
    Preparing search index...

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

    MDN Reference

    interface AudioParam {
        automationRate: AutomationRate;
        defaultValue: number;
        maxValue: number;
        minValue: number;
        value: number;
        cancelAndHoldAtTime(cancelTime: number): AudioParam;
        cancelScheduledValues(cancelTime: number): AudioParam;
        exponentialRampToValueAtTime(value: number, endTime: number): AudioParam;
        linearRampToValueAtTime(value: number, endTime: number): AudioParam;
        setTargetAtTime(
            target: number,
            startTime: number,
            timeConstant: number,
        ): AudioParam;
        setValueAtTime(value: number, startTime: number): AudioParam;
        setValueCurveAtTime(
            values: number[] | Float32Array<ArrayBufferLike>,
            startTime: number,
            duration: number,
        ): AudioParam;
        setValueCurveAtTime(
            values: Iterable<number>,
            startTime: number,
            duration: number,
        ): AudioParam;
    }
    Index

    Properties

    automationRate: AutomationRate
    defaultValue: number

    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.

    MDN Reference

    maxValue: number

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

    MDN Reference

    minValue: number

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

    MDN Reference

    value: number

    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.

    MDN Reference

    Methods

    • 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.

      MDN Reference

      Parameters

      • cancelTime: number

      Returns AudioParam

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

      MDN Reference

      Parameters

      • cancelTime: number

      Returns AudioParam

    • 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.

      MDN Reference

      Parameters

      • value: number
      • endTime: number

      Returns AudioParam

    • 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.

      MDN Reference

      Parameters

      • value: number
      • endTime: number

      Returns 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.

      MDN Reference

      Parameters

      • target: number
      • startTime: number
      • timeConstant: number

      Returns 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.

      MDN Reference

      Parameters

      • value: number
      • startTime: number

      Returns AudioParam

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

      MDN Reference

      Parameters

      Returns AudioParam

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

      MDN Reference

      Parameters

      • values: Iterable<number>
      • startTime: number
      • duration: number

      Returns AudioParam