ConstantSourceNode class

The 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. A 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.

EventTarget

AudioNode

AudioScheduledSourceNode

ConstantSourceNode

Number of inputs 0

Number of outputs 1

Implemented types
Available extensions
Annotations
  • @JS()
  • @staticInterop

Constructors

ConstantSourceNode(BaseAudioContext context, [ConstantSourceOptions? options])
factory

Properties

channelCount int

Available on AudioNode, provided by the PropsAudioNode extension

getter/setter pair
channelCountMode ChannelCountMode

Available on AudioNode, provided by the PropsAudioNode extension

getter/setter pair
channelInterpretation ChannelInterpretation

Available on AudioNode, provided by the PropsAudioNode extension

getter/setter pair
context BaseAudioContext

Available on AudioNode, provided by the PropsAudioNode extension

no setter
hashCode int
The hash code for this object.
no setterinherited
numberOfInputs int

Available on AudioNode, provided by the PropsAudioNode extension

no setter
numberOfOutputs int

Available on AudioNode, provided by the PropsAudioNode extension

no setter
offset AudioParam

Available on ConstantSourceNode, provided by the PropsConstantSourceNode extension

no setter
onended EventHandlerNonNull<Event>?

Available on AudioScheduledSourceNode, provided by the PropsAudioScheduledSourceNode extension

getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

addEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

connect(AudioNode destinationNode, [int? output = 0, int? input = 0]) AudioNode

Available on AudioNode, provided by the PropsAudioNode extension

disconnect([AudioNode? destinationNode, int? output, int? input]) → void

Available on AudioNode, provided by the PropsAudioNode extension

dispatchEvent(Event event) bool

Available on EventTarget, provided by the PropsEventTarget extension

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
removeEventListener(String type, EventListener? callback, [dynamic options]) → void

Available on EventTarget, provided by the PropsEventTarget extension

start([double? when = 0]) → void

Available on AudioScheduledSourceNode, provided by the PropsAudioScheduledSourceNode extension

stop([double? when = 0]) → void

Available on AudioScheduledSourceNode, provided by the PropsAudioScheduledSourceNode extension

toString() String
A string representation of this object.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited