AudioWorkletGlobalScope

The AudioWorkletGlobalScope interface of the Web Audio API represents a global execution context for user-supplied code, which defines custom AudioWorkletProcessor-derived classes.

MDN Reference

Properties

Link copied to clipboard
open external val currentFrame: UInt53

The read-only currentFrame property of the AudioWorkletGlobalScope interface 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.

Link copied to clipboard
open external val currentTime: Double

The read-only currentTime property of the AudioWorkletGlobalScope interface returns a double that represents the ever-increasing context time of the audio block being processed. It is equal to the currentTime property of the BaseAudioContext the worklet belongs to.

Link copied to clipboard
open external val sampleRate: Float

The read-only sampleRate property of the AudioWorkletGlobalScope interface returns a float that represents the sample rate of the associated BaseAudioContext the worklet belongs to.

Functions

Link copied to clipboard
open operator external fun get(key: String): JsAny?
open operator external fun get(key: PropertyKey): JsAny?
Link copied to clipboard

The registerProcessor method of the AudioWorkletGlobalScope interface registers a class constructor derived from AudioWorkletProcessor interface under a specified name.

Link copied to clipboard
open operator external fun set(key: String, value: JsAny?)
open operator external fun set(key: PropertyKey, value: JsAny?)