AudioParam Class

A parameter of an AudioNode (https://webaudio.github.io/web-audio-api/#AudioParam): its value can be set directly, automated with events scheduled on the timeline of the context, and modulated by the outputs of nodes connected to it (summed with the intrinsic value).

public sealed class AudioParam

Properties

NameDescription
AutomationRateGets or sets the automation rate (a-rate: computed for each sample frame; k-rate: once per render quantum).
DefaultValueGets the initial value of the parameter.
MaxValueGets the maximum of the nominal range.
MinValueGets the minimum of the nominal range.
ValueGets or sets the value of the parameter: the intrinsic value at the start of the current render quantum, clamped to the nominal range. Setting it schedules a change of the value at the current time of the context.

AutomationRate

AudioParam.cs

Gets or sets the automation rate (a-rate: computed for each sample frame; k-rate: once per render quantum).

public AutomationRate AutomationRate { get; set; }

Property value

AutomationRate

Exceptions

DomException
The rate of the parameter cannot be changed (an InvalidStateError).

See also

DefaultValue

AudioParam.cs

Gets the initial value of the parameter.

public float DefaultValue { get; }

Gets the maximum of the nominal range.

public float MaxValue { get; }

Gets the minimum of the nominal range.

public float MinValue { get; }

Gets or sets the value of the parameter: the intrinsic value at the start of the current render quantum, clamped to the nominal range. Setting it schedules a change of the value at the current time of the context.

public float Value { get; set; }

Methods

NameDescription
CancelAndHoldAtTime(double)Cancels the events after a time, and holds the value the automation has at that time.
CancelScheduledValues(double)Cancels the events at or after a time.
ExponentialRampToValueAtTime(float, double)Schedules an exponential ramp from the previous event to a value at a time.
LinearRampToValueAtTime(float, double)Schedules a linear ramp from the previous event to a value at a time.
SetTargetAtTime(float, double, float)Schedules an exponential approach to a target value from a time.
SetValueAtTime(float, double)Schedules a change of the value at a time.
SetValueCurveAtTime(IReadOnlyList<float>, double, double)Schedules a curve of values, linearly interpolated, from a time for a duration.

CancelAndHoldAtTime(double)

AudioParam.cs

Cancels the events after a time, and holds the value the automation has at that time.

public AudioParam CancelAndHoldAtTime(double cancelTime)

CancelScheduledValues(double)

AudioParam.cs

Cancels the events at or after a time.

public AudioParam CancelScheduledValues(double cancelTime)

ExponentialRampToValueAtTime(float, double)

AudioParam.cs

Schedules an exponential ramp from the previous event to a value at a time.

public AudioParam ExponentialRampToValueAtTime(float value, double endTime)

LinearRampToValueAtTime(float, double)

AudioParam.cs

Schedules a linear ramp from the previous event to a value at a time.

public AudioParam LinearRampToValueAtTime(float value, double endTime)

SetTargetAtTime(float, double, float)

AudioParam.cs

Schedules an exponential approach to a target value from a time.

public AudioParam SetTargetAtTime(float target, double startTime, float timeConstant)

SetValueAtTime(float, double)

AudioParam.cs

Schedules a change of the value at a time.

public AudioParam SetValueAtTime(float value, double startTime)

SetValueCurveAtTime(IReadOnlyList<float>, double, double)

AudioParam.cs

Schedules a curve of values, linearly interpolated, from a time for a duration.

public AudioParam SetValueCurveAtTime(IReadOnlyList<float> values, double startTime, double duration)