ScriptProcessorNode class
Deprecated: This feature is no longer recommended. Though some browsers might still support it, it may have already been removed from the relevant web standards, may be in the process of being dropped, or may only be kept for compatibility purposes. Avoid using it, and update existing code if possible; see the compatibility table at the bottom of this page to guide your decision. Be aware that this feature may cease to work at any time. The interface allows the generation, processing, or analyzing of audio using JavaScript.
EventTarget
AudioNode
ScriptProcessorNode
Note: This feature was replaced by AudioWorklets and the AudioWorkletNode interface.
The interface is an AudioNode audio-processing module that is linked to two buffers, one containing the input audio data, one containing the processed output audio data. An event, implementing the AudioProcessingEvent interface, is sent to the object each time the input buffer contains new data, and the event handler terminates when it has filled the output buffer with data.
The size of the input and output buffer are defined at the
creation time, when the BaseAudioContext.createScriptProcessor
method is called (both are defined by
BaseAudioContext.createScriptProcessor
's bufferSize
parameter). The buffer size must be a power of 2 between 256
and 16384
, that is 256
, 512
, 1024
, 2048
, 4096
, 8192
or 16384
. Small numbers lower the latency, but large number may
be necessary to avoid audio breakup and glitches.
If the buffer size is not defined, which is recommended, the
browser will pick one that its heuristic deems appropriate.
Number of inputs
1
Number of outputs
1
Channel count mode
"max"
Channel count
2
(not used in the default count mode)
Channel interpretation
"speakers"
- Implemented types
- Available extensions
- Annotations
-
- @Deprecated('Not official in the specs')
- @JS()
- @staticInterop
Constructors
- ScriptProcessorNode()
-
factory
Properties
- bufferSize → int
-
Available on ScriptProcessorNode, provided by the PropsScriptProcessorNode extension
no setter - 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 -
onaudioprocess
↔ EventHandlerNonNull<
Event> ? -
Available on ScriptProcessorNode, provided by the PropsScriptProcessorNode 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
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited