vendor/github.com/go-rod/rod/lib/proto/web_audio.go
426 lines · 12633 bytes
1// This file is generated by "./lib/proto/generate"
2
3package proto
4
5/*
6
7WebAudio
8
9This domain allows inspection of Web Audio API.
10https://webaudio.github.io/web-audio-api/
11
12*/
13
14// WebAudioGraphObjectID An unique ID for a graph object (AudioContext, AudioNode, AudioParam) in Web Audio API.
15type WebAudioGraphObjectID string
16
17// WebAudioContextType Enum of BaseAudioContext types.
18type WebAudioContextType string
19
20const (
21 // WebAudioContextTypeRealtime enum const.
22 WebAudioContextTypeRealtime WebAudioContextType = "realtime"
23
24 // WebAudioContextTypeOffline enum const.
25 WebAudioContextTypeOffline WebAudioContextType = "offline"
26)
27
28// WebAudioContextState Enum of AudioContextState from the spec.
29type WebAudioContextState string
30
31const (
32 // WebAudioContextStateSuspended enum const.
33 WebAudioContextStateSuspended WebAudioContextState = "suspended"
34
35 // WebAudioContextStateRunning enum const.
36 WebAudioContextStateRunning WebAudioContextState = "running"
37
38 // WebAudioContextStateClosed enum const.
39 WebAudioContextStateClosed WebAudioContextState = "closed"
40)
41
42// WebAudioNodeType Enum of AudioNode types.
43type WebAudioNodeType string
44
45// WebAudioChannelCountMode Enum of AudioNode::ChannelCountMode from the spec.
46type WebAudioChannelCountMode string
47
48const (
49 // WebAudioChannelCountModeClampedMax enum const.
50 WebAudioChannelCountModeClampedMax WebAudioChannelCountMode = "clamped-max"
51
52 // WebAudioChannelCountModeExplicit enum const.
53 WebAudioChannelCountModeExplicit WebAudioChannelCountMode = "explicit"
54
55 // WebAudioChannelCountModeMax enum const.
56 WebAudioChannelCountModeMax WebAudioChannelCountMode = "max"
57)
58
59// WebAudioChannelInterpretation Enum of AudioNode::ChannelInterpretation from the spec.
60type WebAudioChannelInterpretation string
61
62const (
63 // WebAudioChannelInterpretationDiscrete enum const.
64 WebAudioChannelInterpretationDiscrete WebAudioChannelInterpretation = "discrete"
65
66 // WebAudioChannelInterpretationSpeakers enum const.
67 WebAudioChannelInterpretationSpeakers WebAudioChannelInterpretation = "speakers"
68)
69
70// WebAudioParamType Enum of AudioParam types.
71type WebAudioParamType string
72
73// WebAudioAutomationRate Enum of AudioParam::AutomationRate from the spec.
74type WebAudioAutomationRate string
75
76const (
77 // WebAudioAutomationRateARate enum const.
78 WebAudioAutomationRateARate WebAudioAutomationRate = "a-rate"
79
80 // WebAudioAutomationRateKRate enum const.
81 WebAudioAutomationRateKRate WebAudioAutomationRate = "k-rate"
82)
83
84// WebAudioContextRealtimeData Fields in AudioContext that change in real-time.
85type WebAudioContextRealtimeData struct {
86 // CurrentTime The current context time in second in BaseAudioContext.
87 CurrentTime float64 `json:"currentTime"`
88
89 // RenderCapacity The time spent on rendering graph divided by render quantum duration,
90 // and multiplied by 100. 100 means the audio renderer reached the full
91 // capacity and glitch may occur.
92 RenderCapacity float64 `json:"renderCapacity"`
93
94 // CallbackIntervalMean A running mean of callback interval.
95 CallbackIntervalMean float64 `json:"callbackIntervalMean"`
96
97 // CallbackIntervalVariance A running variance of callback interval.
98 CallbackIntervalVariance float64 `json:"callbackIntervalVariance"`
99}
100
101// WebAudioBaseAudioContext Protocol object for BaseAudioContext.
102type WebAudioBaseAudioContext struct {
103 // ContextID ...
104 ContextID WebAudioGraphObjectID `json:"contextId"`
105
106 // ContextType ...
107 ContextType WebAudioContextType `json:"contextType"`
108
109 // ContextState ...
110 ContextState WebAudioContextState `json:"contextState"`
111
112 // RealtimeData (optional) ...
113 RealtimeData *WebAudioContextRealtimeData `json:"realtimeData,omitempty"`
114
115 // CallbackBufferSize Platform-dependent callback buffer size.
116 CallbackBufferSize float64 `json:"callbackBufferSize"`
117
118 // MaxOutputChannelCount Number of output channels supported by audio hardware in use.
119 MaxOutputChannelCount float64 `json:"maxOutputChannelCount"`
120
121 // SampleRate Context sample rate.
122 SampleRate float64 `json:"sampleRate"`
123}
124
125// WebAudioAudioListener Protocol object for AudioListener.
126type WebAudioAudioListener struct {
127 // ListenerID ...
128 ListenerID WebAudioGraphObjectID `json:"listenerId"`
129
130 // ContextID ...
131 ContextID WebAudioGraphObjectID `json:"contextId"`
132}
133
134// WebAudioAudioNode Protocol object for AudioNode.
135type WebAudioAudioNode struct {
136 // NodeID ...
137 NodeID WebAudioGraphObjectID `json:"nodeId"`
138
139 // ContextID ...
140 ContextID WebAudioGraphObjectID `json:"contextId"`
141
142 // NodeType ...
143 NodeType WebAudioNodeType `json:"nodeType"`
144
145 // NumberOfInputs ...
146 NumberOfInputs float64 `json:"numberOfInputs"`
147
148 // NumberOfOutputs ...
149 NumberOfOutputs float64 `json:"numberOfOutputs"`
150
151 // ChannelCount ...
152 ChannelCount float64 `json:"channelCount"`
153
154 // ChannelCountMode ...
155 ChannelCountMode WebAudioChannelCountMode `json:"channelCountMode"`
156
157 // ChannelInterpretation ...
158 ChannelInterpretation WebAudioChannelInterpretation `json:"channelInterpretation"`
159}
160
161// WebAudioAudioParam Protocol object for AudioParam.
162type WebAudioAudioParam struct {
163 // ParamID ...
164 ParamID WebAudioGraphObjectID `json:"paramId"`
165
166 // NodeID ...
167 NodeID WebAudioGraphObjectID `json:"nodeId"`
168
169 // ContextID ...
170 ContextID WebAudioGraphObjectID `json:"contextId"`
171
172 // ParamType ...
173 ParamType WebAudioParamType `json:"paramType"`
174
175 // Rate ...
176 Rate WebAudioAutomationRate `json:"rate"`
177
178 // DefaultValue ...
179 DefaultValue float64 `json:"defaultValue"`
180
181 // MinValue ...
182 MinValue float64 `json:"minValue"`
183
184 // MaxValue ...
185 MaxValue float64 `json:"maxValue"`
186}
187
188// WebAudioEnable Enables the WebAudio domain and starts sending context lifetime events.
189type WebAudioEnable struct{}
190
191// ProtoReq name.
192func (m WebAudioEnable) ProtoReq() string { return "WebAudio.enable" }
193
194// Call sends the request.
195func (m WebAudioEnable) Call(c Client) error {
196 return call(m.ProtoReq(), m, nil, c)
197}
198
199// WebAudioDisable Disables the WebAudio domain.
200type WebAudioDisable struct{}
201
202// ProtoReq name.
203func (m WebAudioDisable) ProtoReq() string { return "WebAudio.disable" }
204
205// Call sends the request.
206func (m WebAudioDisable) Call(c Client) error {
207 return call(m.ProtoReq(), m, nil, c)
208}
209
210// WebAudioGetRealtimeData Fetch the realtime data from the registered contexts.
211type WebAudioGetRealtimeData struct {
212 // ContextID ...
213 ContextID WebAudioGraphObjectID `json:"contextId"`
214}
215
216// ProtoReq name.
217func (m WebAudioGetRealtimeData) ProtoReq() string { return "WebAudio.getRealtimeData" }
218
219// Call the request.
220func (m WebAudioGetRealtimeData) Call(c Client) (*WebAudioGetRealtimeDataResult, error) {
221 var res WebAudioGetRealtimeDataResult
222 return &res, call(m.ProtoReq(), m, &res, c)
223}
224
225// WebAudioGetRealtimeDataResult ...
226type WebAudioGetRealtimeDataResult struct {
227 // RealtimeData ...
228 RealtimeData *WebAudioContextRealtimeData `json:"realtimeData"`
229}
230
231// WebAudioContextCreated Notifies that a new BaseAudioContext has been created.
232type WebAudioContextCreated struct {
233 // Context ...
234 Context *WebAudioBaseAudioContext `json:"context"`
235}
236
237// ProtoEvent name.
238func (evt WebAudioContextCreated) ProtoEvent() string {
239 return "WebAudio.contextCreated"
240}
241
242// WebAudioContextWillBeDestroyed Notifies that an existing BaseAudioContext will be destroyed.
243type WebAudioContextWillBeDestroyed struct {
244 // ContextID ...
245 ContextID WebAudioGraphObjectID `json:"contextId"`
246}
247
248// ProtoEvent name.
249func (evt WebAudioContextWillBeDestroyed) ProtoEvent() string {
250 return "WebAudio.contextWillBeDestroyed"
251}
252
253// WebAudioContextChanged Notifies that existing BaseAudioContext has changed some properties (id stays the same)..
254type WebAudioContextChanged struct {
255 // Context ...
256 Context *WebAudioBaseAudioContext `json:"context"`
257}
258
259// ProtoEvent name.
260func (evt WebAudioContextChanged) ProtoEvent() string {
261 return "WebAudio.contextChanged"
262}
263
264// WebAudioAudioListenerCreated Notifies that the construction of an AudioListener has finished.
265type WebAudioAudioListenerCreated struct {
266 // Listener ...
267 Listener *WebAudioAudioListener `json:"listener"`
268}
269
270// ProtoEvent name.
271func (evt WebAudioAudioListenerCreated) ProtoEvent() string {
272 return "WebAudio.audioListenerCreated"
273}
274
275// WebAudioAudioListenerWillBeDestroyed Notifies that a new AudioListener has been created.
276type WebAudioAudioListenerWillBeDestroyed struct {
277 // ContextID ...
278 ContextID WebAudioGraphObjectID `json:"contextId"`
279
280 // ListenerID ...
281 ListenerID WebAudioGraphObjectID `json:"listenerId"`
282}
283
284// ProtoEvent name.
285func (evt WebAudioAudioListenerWillBeDestroyed) ProtoEvent() string {
286 return "WebAudio.audioListenerWillBeDestroyed"
287}
288
289// WebAudioAudioNodeCreated Notifies that a new AudioNode has been created.
290type WebAudioAudioNodeCreated struct {
291 // Node ...
292 Node *WebAudioAudioNode `json:"node"`
293}
294
295// ProtoEvent name.
296func (evt WebAudioAudioNodeCreated) ProtoEvent() string {
297 return "WebAudio.audioNodeCreated"
298}
299
300// WebAudioAudioNodeWillBeDestroyed Notifies that an existing AudioNode has been destroyed.
301type WebAudioAudioNodeWillBeDestroyed struct {
302 // ContextID ...
303 ContextID WebAudioGraphObjectID `json:"contextId"`
304
305 // NodeID ...
306 NodeID WebAudioGraphObjectID `json:"nodeId"`
307}
308
309// ProtoEvent name.
310func (evt WebAudioAudioNodeWillBeDestroyed) ProtoEvent() string {
311 return "WebAudio.audioNodeWillBeDestroyed"
312}
313
314// WebAudioAudioParamCreated Notifies that a new AudioParam has been created.
315type WebAudioAudioParamCreated struct {
316 // Param ...
317 Param *WebAudioAudioParam `json:"param"`
318}
319
320// ProtoEvent name.
321func (evt WebAudioAudioParamCreated) ProtoEvent() string {
322 return "WebAudio.audioParamCreated"
323}
324
325// WebAudioAudioParamWillBeDestroyed Notifies that an existing AudioParam has been destroyed.
326type WebAudioAudioParamWillBeDestroyed struct {
327 // ContextID ...
328 ContextID WebAudioGraphObjectID `json:"contextId"`
329
330 // NodeID ...
331 NodeID WebAudioGraphObjectID `json:"nodeId"`
332
333 // ParamID ...
334 ParamID WebAudioGraphObjectID `json:"paramId"`
335}
336
337// ProtoEvent name.
338func (evt WebAudioAudioParamWillBeDestroyed) ProtoEvent() string {
339 return "WebAudio.audioParamWillBeDestroyed"
340}
341
342// WebAudioNodesConnected Notifies that two AudioNodes are connected.
343type WebAudioNodesConnected struct {
344 // ContextID ...
345 ContextID WebAudioGraphObjectID `json:"contextId"`
346
347 // SourceID ...
348 SourceID WebAudioGraphObjectID `json:"sourceId"`
349
350 // DestinationID ...
351 DestinationID WebAudioGraphObjectID `json:"destinationId"`
352
353 // SourceOutputIndex (optional) ...
354 SourceOutputIndex *float64 `json:"sourceOutputIndex,omitempty"`
355
356 // DestinationInputIndex (optional) ...
357 DestinationInputIndex *float64 `json:"destinationInputIndex,omitempty"`
358}
359
360// ProtoEvent name.
361func (evt WebAudioNodesConnected) ProtoEvent() string {
362 return "WebAudio.nodesConnected"
363}
364
365// WebAudioNodesDisconnected Notifies that AudioNodes are disconnected. The destination can be null, and it means all the outgoing connections from the source are disconnected.
366type WebAudioNodesDisconnected struct {
367 // ContextID ...
368 ContextID WebAudioGraphObjectID `json:"contextId"`
369
370 // SourceID ...
371 SourceID WebAudioGraphObjectID `json:"sourceId"`
372
373 // DestinationID ...
374 DestinationID WebAudioGraphObjectID `json:"destinationId"`
375
376 // SourceOutputIndex (optional) ...
377 SourceOutputIndex *float64 `json:"sourceOutputIndex,omitempty"`
378
379 // DestinationInputIndex (optional) ...
380 DestinationInputIndex *float64 `json:"destinationInputIndex,omitempty"`
381}
382
383// ProtoEvent name.
384func (evt WebAudioNodesDisconnected) ProtoEvent() string {
385 return "WebAudio.nodesDisconnected"
386}
387
388// WebAudioNodeParamConnected Notifies that an AudioNode is connected to an AudioParam.
389type WebAudioNodeParamConnected struct {
390 // ContextID ...
391 ContextID WebAudioGraphObjectID `json:"contextId"`
392
393 // SourceID ...
394 SourceID WebAudioGraphObjectID `json:"sourceId"`
395
396 // DestinationID ...
397 DestinationID WebAudioGraphObjectID `json:"destinationId"`
398
399 // SourceOutputIndex (optional) ...
400 SourceOutputIndex *float64 `json:"sourceOutputIndex,omitempty"`
401}
402
403// ProtoEvent name.
404func (evt WebAudioNodeParamConnected) ProtoEvent() string {
405 return "WebAudio.nodeParamConnected"
406}
407
408// WebAudioNodeParamDisconnected Notifies that an AudioNode is disconnected to an AudioParam.
409type WebAudioNodeParamDisconnected struct {
410 // ContextID ...
411 ContextID WebAudioGraphObjectID `json:"contextId"`
412
413 // SourceID ...
414 SourceID WebAudioGraphObjectID `json:"sourceId"`
415
416 // DestinationID ...
417 DestinationID WebAudioGraphObjectID `json:"destinationId"`
418
419 // SourceOutputIndex (optional) ...
420 SourceOutputIndex *float64 `json:"sourceOutputIndex,omitempty"`
421}
422
423// ProtoEvent name.
424func (evt WebAudioNodeParamDisconnected) ProtoEvent() string {
425 return "WebAudio.nodeParamDisconnected"
426}