Class ConstantSourceNode
- Namespace
- CSharpToJavaScript.APIs.JS
- Assembly
- CSharpToJavaScript.dll
The ConstantSourceNode interface—part of the Web Audio API—represents an audio source (based upon AudioScheduledSourceNode) whose output is single unchanging value. This makes it useful for cases in which you need a constant value coming in from an audio source. In addition, it can be used like a constructible AudioParam by automating the value of its Offset or by connecting another node to it; see Controlling multiple parameters with ConstantSourceNode.
[Value("ConstantSourceNode")]
public class ConstantSourceNode : AudioScheduledSourceNode
- Inheritance
-
ConstantSourceNode
- Inherited Members
Remarks
A ConstantSourceNode has no inputs and exactly one monaural (one-channel) output. The output's value is always the same as the value of the Offset parameter.
Constructors
ConstantSourceNode()
public ConstantSourceNode()
ConstantSourceNode(BaseAudioContext, ConstantSourceOptions)
The ConstantSourceNode() constructor creates a new
ConstantSourceNode object instance, representing an audio source which
constantly outputs samples whose values are always the same.
public ConstantSourceNode(BaseAudioContext context, ConstantSourceOptions options = null)
Parameters
contextBaseAudioContextoptionsConstantSourceOptions
Remarks
Properties
Offset
The read-only offset property of the ConstantSourceNode
interface returns a AudioParam object indicating the numeric a-rate value which is always returned
by the source when asked for the next sample.
[Value("offset")]
public AudioParam Offset { get; }
Property Value
- AudioParam
An AudioParam object indicating the a-rate value returned for every
sample by this node. The default value is 1.0.To access theoffsetparameter's current value, access the parameter'svalueproperty, as shown in the syntax box above.
Remarks
NOTE
While the
AudioParamnamedoffsetis read-only, thevalueproperty within is not. So you can change the value ofoffsetby setting the value ofConstantSourceNode.offset.value:
-Using the Web Audio API
-ConstantSourceNode
-AudioNode
-AudioParam