Table of Contents

Class GainNode

Namespace
CSharpToJavaScript.APIs.JS
Assembly
CSharpToJavaScript.dll

The GainNode interface represents a change in volume. It is an AudioNode audio-processing module that causes a given gain to be applied to the input data before its propagation to the output. A GainNode always has exactly one input and one output, both with the same number of channels.

[Value("GainNode")]
public class GainNode : AudioNode
Inheritance
GainNode
Inherited Members

Remarks

The gain is a unitless value, changing with time, that is multiplied to each corresponding sample of all input channels. If modified, the new gain is instantly applied, causing unaesthetic 'clicks' in the resulting audio. To prevent this from happening, never change the value directly but use the exponential interpolation methods on the AudioParam interface.

The GainNode is increasing the gain of the output.

-Using the Web Audio API

See also on MDN

Constructors

GainNode()

public GainNode()

GainNode(BaseAudioContext, GainOptions)

The GainNode() constructor of the Web Audio API creates a new
GainNode object which is an AudioNode that represents a
change in volume.

public GainNode(BaseAudioContext context, GainOptions options = null)

Parameters

context BaseAudioContext
options GainOptions

Remarks

Properties

Gain

The gain property of the GainNode interface is an a-rate AudioParam representing the amount of gain to apply.

[Value("gain")]
public AudioParam Gain { get; }

Property Value

AudioParam

An AudioParam.

NOTE
Though the AudioParam returned is read-only, the value it represents is not.

Remarks