AudioWorkletGlobalScope Class

The global scope of an AudioWorkletGlobalScope.AudioWorklet (https://webaudio.github.io/web-audio-api/#AudioWorkletGlobalScope): the module scripts register the AudioWorkletProcessor classes with AudioWorkletGlobalScope.RegisterProcessor.

public sealed class AudioWorkletGlobalScope : WorkletGlobalScope
Inheritance
WorkletGlobalScope AudioWorkletGlobalScope

Properties

NameDescription
CurrentFrameGets the frame of the render quantum being processed.
CurrentTimeGets the time of the render quantum being processed.
PortGets the port connected to the port of the AudioWorkletGlobalScope.AudioWorklet.
RenderQuantumSizeGets the render quantum size of the context.
SampleRateGets the sample rate of the context.

CurrentFrame

AudioWorklet.cs

Gets the frame of the render quantum being processed.

public ulong CurrentFrame { get; }

CurrentTime

AudioWorklet.cs

Gets the time of the render quantum being processed.

public double CurrentTime { get; }

Gets the port connected to the port of the AudioWorkletGlobalScope.AudioWorklet.

public MessagePort Port { get; }

RenderQuantumSize

AudioWorklet.cs

Gets the render quantum size of the context.

public uint RenderQuantumSize { get; }

SampleRate

AudioWorklet.cs

Gets the sample rate of the context.

public float SampleRate { get; }

Methods

NameDescription
RegisterProcessor(string, WorkletClassConstructor)Registers a class derived from AudioWorkletProcessor under a name.

RegisterProcessor(string, WorkletClassConstructor)

AudioWorklet.cs

Registers a class derived from AudioWorkletProcessor under a name.

public void RegisterProcessor(string name, WorkletClassConstructor processorCtor)

Parameters

name string
processorCtor WorkletClassConstructor

Exceptions

DomException
The name is empty or already registered, or a parameter descriptor is not valid (a NotSupportedError or an InvalidStateError).

See also