webaudio

package
v0.34.1 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2023 License: MIT Imports: 3 Imported by: 1

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewClient

func NewClient(conn *rpcc.Conn) *domainClient

NewClient returns a client for the WebAudio domain with the connection set to conn.

Types

type AudioListener added in v0.25.0

type AudioListener struct {
	ListenerID GraphObjectID `json:"listenerId"` // No description.
	ContextID  GraphObjectID `json:"contextId"`  // No description.
}

AudioListener Protocol object for AudioListener

type AudioListenerCreatedClient added in v0.25.0

type AudioListenerCreatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*AudioListenerCreatedReply, error)
	rpcc.Stream
}

AudioListenerCreatedClient is a client for AudioListenerCreated events. Notifies that the construction of an AudioListener has finished.

type AudioListenerCreatedReply added in v0.25.0

type AudioListenerCreatedReply struct {
	Listener AudioListener `json:"listener"` // No description.
}

AudioListenerCreatedReply is the reply for AudioListenerCreated events.

type AudioListenerWillBeDestroyedClient added in v0.25.0

type AudioListenerWillBeDestroyedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*AudioListenerWillBeDestroyedReply, error)
	rpcc.Stream
}

AudioListenerWillBeDestroyedClient is a client for AudioListenerWillBeDestroyed events. Notifies that a new AudioListener has been created.

type AudioListenerWillBeDestroyedReply added in v0.25.0

type AudioListenerWillBeDestroyedReply struct {
	ContextID  GraphObjectID `json:"contextId"`  // No description.
	ListenerID GraphObjectID `json:"listenerId"` // No description.
}

AudioListenerWillBeDestroyedReply is the reply for AudioListenerWillBeDestroyed events.

type AudioNode added in v0.25.0

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

AudioNode Protocol object for AudioNode

type AudioNodeCreatedClient added in v0.25.0

type AudioNodeCreatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*AudioNodeCreatedReply, error)
	rpcc.Stream
}

AudioNodeCreatedClient is a client for AudioNodeCreated events. Notifies that a new AudioNode has been created.

type AudioNodeCreatedReply added in v0.25.0

type AudioNodeCreatedReply struct {
	Node AudioNode `json:"node"` // No description.
}

AudioNodeCreatedReply is the reply for AudioNodeCreated events.

type AudioNodeWillBeDestroyedClient added in v0.25.0

type AudioNodeWillBeDestroyedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*AudioNodeWillBeDestroyedReply, error)
	rpcc.Stream
}

AudioNodeWillBeDestroyedClient is a client for AudioNodeWillBeDestroyed events. Notifies that an existing AudioNode has been destroyed.

type AudioNodeWillBeDestroyedReply added in v0.25.0

type AudioNodeWillBeDestroyedReply struct {
	ContextID GraphObjectID `json:"contextId"` // No description.
	NodeID    GraphObjectID `json:"nodeId"`    // No description.
}

AudioNodeWillBeDestroyedReply is the reply for AudioNodeWillBeDestroyed events.

type AudioParam added in v0.25.0

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

AudioParam Protocol object for AudioParam

type AudioParamCreatedClient added in v0.25.0

type AudioParamCreatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*AudioParamCreatedReply, error)
	rpcc.Stream
}

AudioParamCreatedClient is a client for AudioParamCreated events. Notifies that a new AudioParam has been created.

type AudioParamCreatedReply added in v0.25.0

type AudioParamCreatedReply struct {
	Param AudioParam `json:"param"` // No description.
}

AudioParamCreatedReply is the reply for AudioParamCreated events.

type AudioParamWillBeDestroyedClient added in v0.25.0

type AudioParamWillBeDestroyedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*AudioParamWillBeDestroyedReply, error)
	rpcc.Stream
}

AudioParamWillBeDestroyedClient is a client for AudioParamWillBeDestroyed events. Notifies that an existing AudioParam has been destroyed.

type AudioParamWillBeDestroyedReply added in v0.25.0

type AudioParamWillBeDestroyedReply struct {
	ContextID GraphObjectID `json:"contextId"` // No description.
	NodeID    GraphObjectID `json:"nodeId"`    // No description.
	ParamID   GraphObjectID `json:"paramId"`   // No description.
}

AudioParamWillBeDestroyedReply is the reply for AudioParamWillBeDestroyed events.

type AutomationRate added in v0.25.0

type AutomationRate string

AutomationRate Enum of AudioParam::AutomationRate from the spec

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

AutomationRate as enums.

func (AutomationRate) String added in v0.25.0

func (e AutomationRate) String() string

func (AutomationRate) Valid added in v0.25.0

func (e AutomationRate) Valid() bool

type BaseAudioContext

type BaseAudioContext struct {
	ContextID             GraphObjectID        `json:"contextId"`              // No description.
	ContextType           ContextType          `json:"contextType"`            // No description.
	ContextState          ContextState         `json:"contextState"`           // No description.
	RealtimeData          *ContextRealtimeData `json:"realtimeData,omitempty"` // No description.
	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.
}

BaseAudioContext Protocol object for BaseAudioContext

type ChannelCountMode added in v0.25.0

type ChannelCountMode string

ChannelCountMode Enum of AudioNode::ChannelCountMode from the spec

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

ChannelCountMode as enums.

func (ChannelCountMode) String added in v0.25.0

func (e ChannelCountMode) String() string

func (ChannelCountMode) Valid added in v0.25.0

func (e ChannelCountMode) Valid() bool

type ChannelInterpretation added in v0.25.0

type ChannelInterpretation string

ChannelInterpretation Enum of AudioNode::ChannelInterpretation from the spec

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

ChannelInterpretation as enums.

func (ChannelInterpretation) String added in v0.25.0

func (e ChannelInterpretation) String() string

func (ChannelInterpretation) Valid added in v0.25.0

func (e ChannelInterpretation) Valid() bool

type ContextChangedClient

type ContextChangedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*ContextChangedReply, error)
	rpcc.Stream
}

ContextChangedClient is a client for ContextChanged events. Notifies that existing BaseAudioContext has changed some properties (id stays the same)..

type ContextChangedReply

type ContextChangedReply struct {
	Context BaseAudioContext `json:"context"` // No description.
}

ContextChangedReply is the reply for ContextChanged events.

type ContextCreatedClient

type ContextCreatedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*ContextCreatedReply, error)
	rpcc.Stream
}

ContextCreatedClient is a client for ContextCreated events. Notifies that a new BaseAudioContext has been created.

type ContextCreatedReply

type ContextCreatedReply struct {
	Context BaseAudioContext `json:"context"` // No description.
}

ContextCreatedReply is the reply for ContextCreated events.

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.

type ContextState

type ContextState string

ContextState Enum of AudioContextState from the spec

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

ContextState as enums.

func (ContextState) String

func (e ContextState) String() string

func (ContextState) Valid

func (e ContextState) Valid() bool

type ContextType

type ContextType string

ContextType Enum of BaseAudioContext types

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

ContextType as enums.

func (ContextType) String

func (e ContextType) String() string

func (ContextType) Valid

func (e ContextType) Valid() bool

type ContextWillBeDestroyedClient added in v0.25.0

type ContextWillBeDestroyedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*ContextWillBeDestroyedReply, error)
	rpcc.Stream
}

ContextWillBeDestroyedClient is a client for ContextWillBeDestroyed events. Notifies that an existing BaseAudioContext will be destroyed.

type ContextWillBeDestroyedReply added in v0.25.0

type ContextWillBeDestroyedReply struct {
	ContextID GraphObjectID `json:"contextId"` // No description.
}

ContextWillBeDestroyedReply is the reply for ContextWillBeDestroyed events.

type GetRealtimeDataArgs

type GetRealtimeDataArgs struct {
	ContextID GraphObjectID `json:"contextId"` // No description.
}

GetRealtimeDataArgs represents the arguments for GetRealtimeData in the WebAudio domain.

func NewGetRealtimeDataArgs

func NewGetRealtimeDataArgs(contextID GraphObjectID) *GetRealtimeDataArgs

NewGetRealtimeDataArgs initializes GetRealtimeDataArgs with the required arguments.

type GetRealtimeDataReply

type GetRealtimeDataReply struct {
	RealtimeData ContextRealtimeData `json:"realtimeData"` // No description.
}

GetRealtimeDataReply represents the return values for GetRealtimeData in the WebAudio domain.

type GraphObjectID added in v0.25.0

type GraphObjectID string

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

type NodeParamConnectedClient added in v0.25.0

type NodeParamConnectedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*NodeParamConnectedReply, error)
	rpcc.Stream
}

NodeParamConnectedClient is a client for NodeParamConnected events. Notifies that an AudioNode is connected to an AudioParam.

type NodeParamConnectedReply added in v0.25.0

type NodeParamConnectedReply struct {
	ContextID         GraphObjectID `json:"contextId"`                   // No description.
	SourceID          GraphObjectID `json:"sourceId"`                    // No description.
	DestinationID     GraphObjectID `json:"destinationId"`               // No description.
	SourceOutputIndex *float64      `json:"sourceOutputIndex,omitempty"` // No description.
}

NodeParamConnectedReply is the reply for NodeParamConnected events.

type NodeParamDisconnectedClient added in v0.25.0

type NodeParamDisconnectedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*NodeParamDisconnectedReply, error)
	rpcc.Stream
}

NodeParamDisconnectedClient is a client for NodeParamDisconnected events. Notifies that an AudioNode is disconnected to an AudioParam.

type NodeParamDisconnectedReply added in v0.25.0

type NodeParamDisconnectedReply struct {
	ContextID         GraphObjectID `json:"contextId"`                   // No description.
	SourceID          GraphObjectID `json:"sourceId"`                    // No description.
	DestinationID     GraphObjectID `json:"destinationId"`               // No description.
	SourceOutputIndex *float64      `json:"sourceOutputIndex,omitempty"` // No description.
}

NodeParamDisconnectedReply is the reply for NodeParamDisconnected events.

type NodeType added in v0.25.0

type NodeType string

NodeType Enum of AudioNode types

type NodesConnectedClient added in v0.25.0

type NodesConnectedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*NodesConnectedReply, error)
	rpcc.Stream
}

NodesConnectedClient is a client for NodesConnected events. Notifies that two AudioNodes are connected.

type NodesConnectedReply added in v0.25.0

type NodesConnectedReply struct {
	ContextID             GraphObjectID `json:"contextId"`                       // No description.
	SourceID              GraphObjectID `json:"sourceId"`                        // No description.
	DestinationID         GraphObjectID `json:"destinationId"`                   // No description.
	SourceOutputIndex     *float64      `json:"sourceOutputIndex,omitempty"`     // No description.
	DestinationInputIndex *float64      `json:"destinationInputIndex,omitempty"` // No description.
}

NodesConnectedReply is the reply for NodesConnected events.

type NodesDisconnectedClient added in v0.25.0

type NodesDisconnectedClient interface {
	// Recv calls RecvMsg on rpcc.Stream, blocks until the event is
	// triggered, context canceled or connection closed.
	Recv() (*NodesDisconnectedReply, error)
	rpcc.Stream
}

NodesDisconnectedClient is a client for NodesDisconnected events. Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.

type NodesDisconnectedReply added in v0.25.0

type NodesDisconnectedReply struct {
	ContextID             GraphObjectID `json:"contextId"`                       // No description.
	SourceID              GraphObjectID `json:"sourceId"`                        // No description.
	DestinationID         GraphObjectID `json:"destinationId"`                   // No description.
	SourceOutputIndex     *float64      `json:"sourceOutputIndex,omitempty"`     // No description.
	DestinationInputIndex *float64      `json:"destinationInputIndex,omitempty"` // No description.
}

NodesDisconnectedReply is the reply for NodesDisconnected events.

type ParamType added in v0.25.0

type ParamType string

ParamType Enum of AudioParam types

Jump to

Keyboard shortcuts

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