Help us shape the future of Go! Take the 2026 Go Developer Survey

webaudio

package
v0.159.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 31, 2026 License: MIT Imports: 1 Imported by: 3

Documentation

Overview

Package webaudio provides the Chrome DevTools Protocol commands, types, and events for the WebAudio domain.

This domain allows inspection of Web Audio API. https://webaudio.github.io/web-audio-api/.

Generated by the pdlgen command.

Index

Constants

View Source
const (
	CommandEnable          = "WebAudio.enable"
	CommandDisable         = "WebAudio.disable"
	CommandGetRealtimeData = "WebAudio.getRealtimeData"
)

Command names.

Variables

View Source
var AudioListenerCreated = cdp.Event[EventAudioListenerCreated]{Method: "WebAudio.audioListenerCreated"}

AudioListenerCreated notifies that the construction of an AudioListener has finished.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioListenerCreated

View Source
var AudioListenerWillBeDestroyed = cdp.Event[EventAudioListenerWillBeDestroyed]{Method: "WebAudio.audioListenerWillBeDestroyed"}

AudioListenerWillBeDestroyed notifies that a new AudioListener has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioListenerWillBeDestroyed

View Source
var AudioNodeCreated = cdp.Event[EventAudioNodeCreated]{Method: "WebAudio.audioNodeCreated"}

AudioNodeCreated notifies that a new AudioNode has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioNodeCreated

View Source
var AudioNodeWillBeDestroyed = cdp.Event[EventAudioNodeWillBeDestroyed]{Method: "WebAudio.audioNodeWillBeDestroyed"}

AudioNodeWillBeDestroyed notifies that an existing AudioNode has been destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioNodeWillBeDestroyed

View Source
var AudioParamCreated = cdp.Event[EventAudioParamCreated]{Method: "WebAudio.audioParamCreated"}

AudioParamCreated notifies that a new AudioParam has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioParamCreated

View Source
var AudioParamWillBeDestroyed = cdp.Event[EventAudioParamWillBeDestroyed]{Method: "WebAudio.audioParamWillBeDestroyed"}

AudioParamWillBeDestroyed notifies that an existing AudioParam has been destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioParamWillBeDestroyed

View Source
var ContextChanged = cdp.Event[EventContextChanged]{Method: "WebAudio.contextChanged"}

ContextChanged notifies that existing BaseAudioContext has changed some properties (id stays the same)..

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-contextChanged

View Source
var ContextCreated = cdp.Event[EventContextCreated]{Method: "WebAudio.contextCreated"}

ContextCreated notifies that a new BaseAudioContext has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-contextCreated

View Source
var ContextWillBeDestroyed = cdp.Event[EventContextWillBeDestroyed]{Method: "WebAudio.contextWillBeDestroyed"}

ContextWillBeDestroyed notifies that an existing BaseAudioContext will be destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-contextWillBeDestroyed

View Source
var Disable = cdp.Command[cdp.Empty, cdp.Empty]{Method: CommandDisable}

Disable disables the WebAudio domain.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#method-disable

Enable enables the WebAudio domain and starts sending context lifetime events.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#method-enable

GetRealtimeData fetch the realtime data from the registered contexts.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#method-getRealtimeData

View Source
var NodeParamConnected = cdp.Event[EventNodeParamConnected]{Method: "WebAudio.nodeParamConnected"}

NodeParamConnected notifies that an AudioNode is connected to an AudioParam.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodeParamConnected

View Source
var NodeParamDisconnected = cdp.Event[EventNodeParamDisconnected]{Method: "WebAudio.nodeParamDisconnected"}

NodeParamDisconnected notifies that an AudioNode is disconnected to an AudioParam.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodeParamDisconnected

View Source
var NodesConnected = cdp.Event[EventNodesConnected]{Method: "WebAudio.nodesConnected"}

NodesConnected notifies that two AudioNodes are connected.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodesConnected

View Source
var NodesDisconnected = cdp.Event[EventNodesDisconnected]{Method: "WebAudio.nodesDisconnected"}

NodesDisconnected notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodesDisconnected

Functions

This section is empty.

Types

type AudioListener

type AudioListener struct {
	ListenerID GraphObjectID `json:"listenerId"`
	ContextID  GraphObjectID `json:"contextId"`
}

AudioListener protocol object for AudioListener.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-AudioListener

type AudioNode

type AudioNode struct {
	NodeID                GraphObjectID         `json:"nodeId"`
	ContextID             GraphObjectID         `json:"contextId"`
	NodeType              NodeType              `json:"nodeType"`
	NumberOfInputs        float64               `json:"numberOfInputs"`
	NumberOfOutputs       float64               `json:"numberOfOutputs"`
	ChannelCount          float64               `json:"channelCount"`
	ChannelCountMode      ChannelCountMode      `json:"channelCountMode"`
	ChannelInterpretation ChannelInterpretation `json:"channelInterpretation"`
}

AudioNode protocol object for AudioNode.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-AudioNode

type AudioParam

type AudioParam struct {
	ParamID      GraphObjectID  `json:"paramId"`
	NodeID       GraphObjectID  `json:"nodeId"`
	ContextID    GraphObjectID  `json:"contextId"`
	ParamType    ParamType      `json:"paramType"`
	Rate         AutomationRate `json:"rate"`
	DefaultValue float64        `json:"defaultValue"`
	MinValue     float64        `json:"minValue"`
	MaxValue     float64        `json:"maxValue"`
}

AudioParam protocol object for AudioParam.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-AudioParam

type AutomationRate

type AutomationRate string

AutomationRate enum of AudioParam::AutomationRate from the spec.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-AutomationRate

const (
	AutomationRateARate AutomationRate = "a-rate"
	AutomationRateKRate AutomationRate = "k-rate"
)

AutomationRate values.

func (AutomationRate) String

func (t AutomationRate) String() string

String returns the AutomationRate as string value.

type BaseAudioContext

type BaseAudioContext struct {
	ContextID             GraphObjectID        `json:"contextId"`
	ContextType           ContextType          `json:"contextType"`
	ContextState          ContextState         `json:"contextState"`
	RealtimeData          *ContextRealtimeData `json:"realtimeData,omitempty,omitzero"`
	CallbackBufferSize    float64              `json:"callbackBufferSize"`    // Platform-dependent callback buffer size.
	MaxOutputChannelCount float64              `json:"maxOutputChannelCount"` // Number of output channels supported by audio hardware in use.
	SampleRate            float64              `json:"sampleRate"`            // Context sample rate.
	RenderQuantumSize     float64              `json:"renderQuantumSize"`
}

BaseAudioContext protocol object for BaseAudioContext.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-BaseAudioContext

type ChannelCountMode

type ChannelCountMode string

ChannelCountMode enum of AudioNode::ChannelCountMode from the spec.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-ChannelCountMode

const (
	ChannelCountModeClampedMax ChannelCountMode = "clamped-max"
	ChannelCountModeExplicit   ChannelCountMode = "explicit"
	ChannelCountModeMax        ChannelCountMode = "max"
)

ChannelCountMode values.

func (ChannelCountMode) String

func (t ChannelCountMode) String() string

String returns the ChannelCountMode as string value.

type ChannelInterpretation

type ChannelInterpretation string

ChannelInterpretation enum of AudioNode::ChannelInterpretation from the spec.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-ChannelInterpretation

const (
	ChannelInterpretationDiscrete ChannelInterpretation = "discrete"
	ChannelInterpretationSpeakers ChannelInterpretation = "speakers"
)

ChannelInterpretation values.

func (ChannelInterpretation) String

func (t ChannelInterpretation) String() string

String returns the ChannelInterpretation as string value.

type ContextRealtimeData

type ContextRealtimeData struct {
	CurrentTime              float64 `json:"currentTime"`              // The current context time in second in BaseAudioContext.
	RenderCapacity           float64 `json:"renderCapacity"`           // The time spent on rendering graph divided by render quantum duration, and multiplied by 100. 100 means the audio renderer reached the full capacity and glitch may occur.
	CallbackIntervalMean     float64 `json:"callbackIntervalMean"`     // A running mean of callback interval.
	CallbackIntervalVariance float64 `json:"callbackIntervalVariance"` // A running variance of callback interval.
}

ContextRealtimeData fields in AudioContext that change in real-time.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-ContextRealtimeData

type ContextState

type ContextState string

ContextState enum of AudioContextState from the spec.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-ContextState

const (
	ContextStateSuspended   ContextState = "suspended"
	ContextStateRunning     ContextState = "running"
	ContextStateClosed      ContextState = "closed"
	ContextStateInterrupted ContextState = "interrupted"
)

ContextState values.

func (ContextState) String

func (t ContextState) String() string

String returns the ContextState as string value.

type ContextType

type ContextType string

ContextType enum of BaseAudioContext types.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-ContextType

const (
	ContextTypeRealtime ContextType = "realtime"
	ContextTypeOffline  ContextType = "offline"
)

ContextType values.

func (ContextType) String

func (t ContextType) String() string

String returns the ContextType as string value.

type EventAudioListenerCreated

type EventAudioListenerCreated struct {
	Listener *AudioListener `json:"listener"`
}

EventAudioListenerCreated notifies that the construction of an AudioListener has finished.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioListenerCreated

type EventAudioListenerWillBeDestroyed

type EventAudioListenerWillBeDestroyed struct {
	ContextID  GraphObjectID `json:"contextId"`
	ListenerID GraphObjectID `json:"listenerId"`
}

EventAudioListenerWillBeDestroyed notifies that a new AudioListener has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioListenerWillBeDestroyed

type EventAudioNodeCreated

type EventAudioNodeCreated struct {
	Node *AudioNode `json:"node"`
}

EventAudioNodeCreated notifies that a new AudioNode has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioNodeCreated

type EventAudioNodeWillBeDestroyed

type EventAudioNodeWillBeDestroyed struct {
	ContextID GraphObjectID `json:"contextId"`
	NodeID    GraphObjectID `json:"nodeId"`
}

EventAudioNodeWillBeDestroyed notifies that an existing AudioNode has been destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioNodeWillBeDestroyed

type EventAudioParamCreated

type EventAudioParamCreated struct {
	Param *AudioParam `json:"param"`
}

EventAudioParamCreated notifies that a new AudioParam has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioParamCreated

type EventAudioParamWillBeDestroyed

type EventAudioParamWillBeDestroyed struct {
	ContextID GraphObjectID `json:"contextId"`
	NodeID    GraphObjectID `json:"nodeId"`
	ParamID   GraphObjectID `json:"paramId"`
}

EventAudioParamWillBeDestroyed notifies that an existing AudioParam has been destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-audioParamWillBeDestroyed

type EventContextChanged

type EventContextChanged struct {
	Context *BaseAudioContext `json:"context"`
}

EventContextChanged notifies that existing BaseAudioContext has changed some properties (id stays the same)..

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-contextChanged

type EventContextCreated

type EventContextCreated struct {
	Context *BaseAudioContext `json:"context"`
}

EventContextCreated notifies that a new BaseAudioContext has been created.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-contextCreated

type EventContextWillBeDestroyed

type EventContextWillBeDestroyed struct {
	ContextID GraphObjectID `json:"contextId"`
}

EventContextWillBeDestroyed notifies that an existing BaseAudioContext will be destroyed.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-contextWillBeDestroyed

type EventNodeParamConnected

type EventNodeParamConnected struct {
	ContextID         GraphObjectID `json:"contextId"`
	SourceID          GraphObjectID `json:"sourceId"`
	DestinationID     GraphObjectID `json:"destinationId"`
	SourceOutputIndex float64       `json:"sourceOutputIndex,omitempty,omitzero"`
}

EventNodeParamConnected notifies that an AudioNode is connected to an AudioParam.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodeParamConnected

type EventNodeParamDisconnected

type EventNodeParamDisconnected struct {
	ContextID         GraphObjectID `json:"contextId"`
	SourceID          GraphObjectID `json:"sourceId"`
	DestinationID     GraphObjectID `json:"destinationId"`
	SourceOutputIndex float64       `json:"sourceOutputIndex,omitempty,omitzero"`
}

EventNodeParamDisconnected notifies that an AudioNode is disconnected to an AudioParam.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodeParamDisconnected

type EventNodesConnected

type EventNodesConnected struct {
	ContextID             GraphObjectID `json:"contextId"`
	SourceID              GraphObjectID `json:"sourceId"`
	DestinationID         GraphObjectID `json:"destinationId"`
	SourceOutputIndex     float64       `json:"sourceOutputIndex,omitempty,omitzero"`
	DestinationInputIndex float64       `json:"destinationInputIndex,omitempty,omitzero"`
}

EventNodesConnected notifies that two AudioNodes are connected.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodesConnected

type EventNodesDisconnected

type EventNodesDisconnected struct {
	ContextID             GraphObjectID `json:"contextId"`
	SourceID              GraphObjectID `json:"sourceId"`
	DestinationID         GraphObjectID `json:"destinationId"`
	SourceOutputIndex     float64       `json:"sourceOutputIndex,omitempty,omitzero"`
	DestinationInputIndex float64       `json:"destinationInputIndex,omitempty,omitzero"`
}

EventNodesDisconnected notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#event-nodesDisconnected

type GetRealtimeDataParams

type GetRealtimeDataParams struct {
	ContextID GraphObjectID `json:"contextId"`
}

GetRealtimeDataParams are the parameters of the command WebAudio.getRealtimeData.

type GetRealtimeDataResult added in v0.157.3

type GetRealtimeDataResult struct {
	RealtimeData *ContextRealtimeData `json:"realtimeData,omitempty,omitzero"`
}

GetRealtimeDataResult is the result of the command WebAudio.getRealtimeData.

type GraphObjectID

type GraphObjectID string

GraphObjectID an unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-GraphObjectId

func (GraphObjectID) String

func (t GraphObjectID) String() string

String returns the GraphObjectID as string value.

type NodeType

type NodeType string

NodeType enum of AudioNode types.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-NodeType

func (NodeType) String

func (t NodeType) String() string

String returns the NodeType as string value.

type ParamType

type ParamType string

ParamType enum of AudioParam types.

See: https://chromedevtools.github.io/devtools-protocol/tot/WebAudio#type-ParamType

func (ParamType) String

func (t ParamType) String() string

String returns the ParamType as string value.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL