AudioWorkletGlobalScope class abstract
The AudioWorkletGlobalScope
of the
Web Audio API
represents a global execution context for user-supplied code, which defines
custom AudioWorkletProcessor-derived classes.
Each BaseAudioContext has a single AudioWorklet available under the
BaseAudioContext.audioWorklet property, which runs its code in a single
AudioWorkletGlobalScope
.
As the global execution context is shared across the current
BaseAudioContext
, it's possible to define any other variables and perform
any actions allowed in worklets — apart from defining
AudioWorkletProcessor
derived classes.
API documentation sourced from MDN Web Docs.
Constructors
Properties
- currentFrame → int
-
The read-only
currentFrame
property of the AudioWorkletGlobalScope returns an integer that represents the ever-increasing current sample-frame of the audio block being processed. It is incremented by 128 (the size of a render quantum) after the processing of each audio block.no setter - currentTime → TauTime
-
The read-only
currentTime
property of the AudioWorkletGlobalScope returns a double that represents the ever-increasing context time of the audio block being processed. It is equal to the BaseAudioContext.currentTime property of the BaseAudioContext the worklet belongs to.no setter - hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- sampleRate → TauSampleRate
-
The read-only
sampleRate
property of the AudioWorkletGlobalScope returns a float that represents the sample rate of the associated BaseAudioContext the worklet belongs to.no setter
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerProcessor(
String name, AudioWorkletProcessorConstructor processorCtor) → void -
The
registerProcessor
method of the AudioWorkletGlobalScope registers a class constructor derived from AudioWorkletProcessor under a specified name. -
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited