Skip to main content

web_sys/features/
gen_AudioContext.rs

1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "C" {
7    #[wasm_bindgen(
8        vendor_prefix = "webkit",
9        extends = "BaseAudioContext",
10        extends = "EventTarget",
11        extends = "::js_sys::Object",
12        js_name = "AudioContext",
13        typescript_type = "AudioContext"
14    )]
15    #[derive(Debug, Clone, PartialEq, Eq)]
16    #[doc = "The `AudioContext` class."]
17    #[doc = ""]
18    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext)"]
19    #[doc = ""]
20    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
21    pub type AudioContext;
22    #[cfg(web_sys_unstable_apis)]
23    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "sinkId")]
24    #[doc = "Getter for the `sinkId` field of this object."]
25    #[doc = ""]
26    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/sinkId)"]
27    #[doc = ""]
28    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
29    #[doc = ""]
30    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
31    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
32    pub fn sink_id(this: &AudioContext) -> ::wasm_bindgen::JsValue;
33    #[cfg(web_sys_unstable_apis)]
34    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "onsinkchange")]
35    #[doc = "Getter for the `onsinkchange` field of this object."]
36    #[doc = ""]
37    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onsinkchange)"]
38    #[doc = ""]
39    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
40    #[doc = ""]
41    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
42    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
43    pub fn onsinkchange(this: &AudioContext) -> Option<::js_sys::Function>;
44    #[cfg(web_sys_unstable_apis)]
45    #[wasm_bindgen(method, setter, js_class = "AudioContext", js_name = "onsinkchange")]
46    #[doc = "Setter for the `onsinkchange` field of this object."]
47    #[doc = ""]
48    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onsinkchange)"]
49    #[doc = ""]
50    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
51    #[doc = ""]
52    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
53    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
54    pub fn set_onsinkchange(this: &AudioContext, value: Option<&::js_sys::Function>);
55    #[cfg(feature = "AudioDestinationNode")]
56    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "destination")]
57    #[doc = "Getter for the `destination` field of this object."]
58    #[doc = ""]
59    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/destination)"]
60    #[doc = ""]
61    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioDestinationNode`*"]
62    pub fn destination(this: &AudioContext) -> AudioDestinationNode;
63    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "sampleRate")]
64    #[doc = "Getter for the `sampleRate` field of this object."]
65    #[doc = ""]
66    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/sampleRate)"]
67    #[doc = ""]
68    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
69    pub fn sample_rate(this: &AudioContext) -> f32;
70    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "currentTime")]
71    #[doc = "Getter for the `currentTime` field of this object."]
72    #[doc = ""]
73    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/currentTime)"]
74    #[doc = ""]
75    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
76    pub fn current_time(this: &AudioContext) -> f64;
77    #[cfg(feature = "AudioListener")]
78    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "listener")]
79    #[doc = "Getter for the `listener` field of this object."]
80    #[doc = ""]
81    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/listener)"]
82    #[doc = ""]
83    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioListener`*"]
84    pub fn listener(this: &AudioContext) -> AudioListener;
85    #[cfg(feature = "AudioContextState")]
86    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "state")]
87    #[doc = "Getter for the `state` field of this object."]
88    #[doc = ""]
89    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/state)"]
90    #[doc = ""]
91    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioContextState`*"]
92    pub fn state(this: &AudioContext) -> AudioContextState;
93    #[cfg(feature = "AudioWorklet")]
94    #[wasm_bindgen(
95        catch,
96        method,
97        getter,
98        js_class = "AudioContext",
99        js_name = "audioWorklet"
100    )]
101    #[doc = "Getter for the `audioWorklet` field of this object."]
102    #[doc = ""]
103    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/audioWorklet)"]
104    #[doc = ""]
105    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioWorklet`*"]
106    pub fn audio_worklet(this: &AudioContext) -> Result<AudioWorklet, JsValue>;
107    #[wasm_bindgen(method, getter, js_class = "AudioContext", js_name = "onstatechange")]
108    #[doc = "Getter for the `onstatechange` field of this object."]
109    #[doc = ""]
110    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onstatechange)"]
111    #[doc = ""]
112    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
113    pub fn onstatechange(this: &AudioContext) -> Option<::js_sys::Function>;
114    #[wasm_bindgen(method, setter, js_class = "AudioContext", js_name = "onstatechange")]
115    #[doc = "Setter for the `onstatechange` field of this object."]
116    #[doc = ""]
117    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/onstatechange)"]
118    #[doc = ""]
119    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
120    pub fn set_onstatechange(this: &AudioContext, value: Option<&::js_sys::Function>);
121    #[wasm_bindgen(catch, constructor, js_class = "AudioContext")]
122    #[doc = "The `new AudioContext(..)` constructor, creating a new instance of `AudioContext`."]
123    #[doc = ""]
124    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext)"]
125    #[doc = ""]
126    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
127    pub fn new() -> Result<AudioContext, JsValue>;
128    #[cfg(feature = "AudioContextOptions")]
129    #[wasm_bindgen(catch, constructor, js_class = "AudioContext")]
130    #[doc = "The `new AudioContext(..)` constructor, creating a new instance of `AudioContext`."]
131    #[doc = ""]
132    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/AudioContext)"]
133    #[doc = ""]
134    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioContextOptions`*"]
135    pub fn new_with_context_options(
136        context_options: &AudioContextOptions,
137    ) -> Result<AudioContext, JsValue>;
138    #[wasm_bindgen(catch, method, js_class = "AudioContext")]
139    #[doc = "The `close()` method."]
140    #[doc = ""]
141    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/close)"]
142    #[doc = ""]
143    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
144    pub fn close(this: &AudioContext) -> Result<::js_sys::Promise, JsValue>;
145    #[cfg(all(feature = "HtmlMediaElement", feature = "MediaElementAudioSourceNode",))]
146    #[wasm_bindgen(
147        catch,
148        method,
149        js_class = "AudioContext",
150        js_name = "createMediaElementSource"
151    )]
152    #[doc = "The `createMediaElementSource()` method."]
153    #[doc = ""]
154    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaElementSource)"]
155    #[doc = ""]
156    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `HtmlMediaElement`, `MediaElementAudioSourceNode`*"]
157    pub fn create_media_element_source(
158        this: &AudioContext,
159        media_element: &HtmlMediaElement,
160    ) -> Result<MediaElementAudioSourceNode, JsValue>;
161    #[cfg(feature = "MediaStreamAudioDestinationNode")]
162    #[wasm_bindgen(
163        catch,
164        method,
165        js_class = "AudioContext",
166        js_name = "createMediaStreamDestination"
167    )]
168    #[doc = "The `createMediaStreamDestination()` method."]
169    #[doc = ""]
170    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamDestination)"]
171    #[doc = ""]
172    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `MediaStreamAudioDestinationNode`*"]
173    pub fn create_media_stream_destination(
174        this: &AudioContext,
175    ) -> Result<MediaStreamAudioDestinationNode, JsValue>;
176    #[cfg(all(feature = "MediaStream", feature = "MediaStreamAudioSourceNode",))]
177    #[wasm_bindgen(
178        catch,
179        method,
180        js_class = "AudioContext",
181        js_name = "createMediaStreamSource"
182    )]
183    #[doc = "The `createMediaStreamSource()` method."]
184    #[doc = ""]
185    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createMediaStreamSource)"]
186    #[doc = ""]
187    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `MediaStream`, `MediaStreamAudioSourceNode`*"]
188    pub fn create_media_stream_source(
189        this: &AudioContext,
190        media_stream: &MediaStream,
191    ) -> Result<MediaStreamAudioSourceNode, JsValue>;
192    #[cfg(web_sys_unstable_apis)]
193    #[wasm_bindgen(method, js_class = "AudioContext", js_name = "setSinkId")]
194    #[doc = "The `setSinkId()` method."]
195    #[doc = ""]
196    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId)"]
197    #[doc = ""]
198    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
199    #[doc = ""]
200    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
201    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
202    pub fn set_sink_id_with_str(
203        this: &AudioContext,
204        sink_id: &str,
205    ) -> ::js_sys::Promise<::js_sys::Undefined>;
206    #[cfg(web_sys_unstable_apis)]
207    #[cfg(feature = "AudioSinkOptions")]
208    #[wasm_bindgen(method, js_class = "AudioContext", js_name = "setSinkId")]
209    #[doc = "The `setSinkId()` method."]
210    #[doc = ""]
211    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/setSinkId)"]
212    #[doc = ""]
213    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `AudioSinkOptions`*"]
214    #[doc = ""]
215    #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
216    #[doc = "[described in the `wasm-bindgen` guide](https://wasm-bindgen.github.io/wasm-bindgen/web-sys/unstable-apis.html)*"]
217    pub fn set_sink_id_with_audio_sink_options(
218        this: &AudioContext,
219        sink_id: &AudioSinkOptions,
220    ) -> ::js_sys::Promise<::js_sys::Undefined>;
221    #[wasm_bindgen(catch, method, js_class = "AudioContext")]
222    #[doc = "The `suspend()` method."]
223    #[doc = ""]
224    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/suspend)"]
225    #[doc = ""]
226    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
227    pub fn suspend(this: &AudioContext) -> Result<::js_sys::Promise, JsValue>;
228    #[cfg(feature = "AnalyserNode")]
229    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createAnalyser")]
230    #[doc = "The `createAnalyser()` method."]
231    #[doc = ""]
232    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createAnalyser)"]
233    #[doc = ""]
234    #[doc = "*This API requires the following crate features to be activated: `AnalyserNode`, `AudioContext`*"]
235    pub fn create_analyser(this: &AudioContext) -> Result<AnalyserNode, JsValue>;
236    #[cfg(feature = "BiquadFilterNode")]
237    #[wasm_bindgen(
238        catch,
239        method,
240        js_class = "AudioContext",
241        js_name = "createBiquadFilter"
242    )]
243    #[doc = "The `createBiquadFilter()` method."]
244    #[doc = ""]
245    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBiquadFilter)"]
246    #[doc = ""]
247    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `BiquadFilterNode`*"]
248    pub fn create_biquad_filter(this: &AudioContext) -> Result<BiquadFilterNode, JsValue>;
249    #[cfg(feature = "AudioBuffer")]
250    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createBuffer")]
251    #[doc = "The `createBuffer()` method."]
252    #[doc = ""]
253    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBuffer)"]
254    #[doc = ""]
255    #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioContext`*"]
256    pub fn create_buffer(
257        this: &AudioContext,
258        number_of_channels: u32,
259        length: u32,
260        sample_rate: f32,
261    ) -> Result<AudioBuffer, JsValue>;
262    #[cfg(feature = "AudioBufferSourceNode")]
263    #[wasm_bindgen(
264        catch,
265        method,
266        js_class = "AudioContext",
267        js_name = "createBufferSource"
268    )]
269    #[doc = "The `createBufferSource()` method."]
270    #[doc = ""]
271    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createBufferSource)"]
272    #[doc = ""]
273    #[doc = "*This API requires the following crate features to be activated: `AudioBufferSourceNode`, `AudioContext`*"]
274    pub fn create_buffer_source(this: &AudioContext) -> Result<AudioBufferSourceNode, JsValue>;
275    #[cfg(feature = "ChannelMergerNode")]
276    #[wasm_bindgen(
277        catch,
278        method,
279        js_class = "AudioContext",
280        js_name = "createChannelMerger"
281    )]
282    #[doc = "The `createChannelMerger()` method."]
283    #[doc = ""]
284    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelMerger)"]
285    #[doc = ""]
286    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelMergerNode`*"]
287    pub fn create_channel_merger(this: &AudioContext) -> Result<ChannelMergerNode, JsValue>;
288    #[cfg(feature = "ChannelMergerNode")]
289    #[wasm_bindgen(
290        catch,
291        method,
292        js_class = "AudioContext",
293        js_name = "createChannelMerger"
294    )]
295    #[doc = "The `createChannelMerger()` method."]
296    #[doc = ""]
297    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelMerger)"]
298    #[doc = ""]
299    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelMergerNode`*"]
300    pub fn create_channel_merger_with_number_of_inputs(
301        this: &AudioContext,
302        number_of_inputs: u32,
303    ) -> Result<ChannelMergerNode, JsValue>;
304    #[cfg(feature = "ChannelSplitterNode")]
305    #[wasm_bindgen(
306        catch,
307        method,
308        js_class = "AudioContext",
309        js_name = "createChannelSplitter"
310    )]
311    #[doc = "The `createChannelSplitter()` method."]
312    #[doc = ""]
313    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelSplitter)"]
314    #[doc = ""]
315    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelSplitterNode`*"]
316    pub fn create_channel_splitter(this: &AudioContext) -> Result<ChannelSplitterNode, JsValue>;
317    #[cfg(feature = "ChannelSplitterNode")]
318    #[wasm_bindgen(
319        catch,
320        method,
321        js_class = "AudioContext",
322        js_name = "createChannelSplitter"
323    )]
324    #[doc = "The `createChannelSplitter()` method."]
325    #[doc = ""]
326    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createChannelSplitter)"]
327    #[doc = ""]
328    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ChannelSplitterNode`*"]
329    pub fn create_channel_splitter_with_number_of_outputs(
330        this: &AudioContext,
331        number_of_outputs: u32,
332    ) -> Result<ChannelSplitterNode, JsValue>;
333    #[cfg(feature = "ConstantSourceNode")]
334    #[wasm_bindgen(
335        catch,
336        method,
337        js_class = "AudioContext",
338        js_name = "createConstantSource"
339    )]
340    #[doc = "The `createConstantSource()` method."]
341    #[doc = ""]
342    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createConstantSource)"]
343    #[doc = ""]
344    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ConstantSourceNode`*"]
345    pub fn create_constant_source(this: &AudioContext) -> Result<ConstantSourceNode, JsValue>;
346    #[cfg(feature = "ConvolverNode")]
347    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createConvolver")]
348    #[doc = "The `createConvolver()` method."]
349    #[doc = ""]
350    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createConvolver)"]
351    #[doc = ""]
352    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ConvolverNode`*"]
353    pub fn create_convolver(this: &AudioContext) -> Result<ConvolverNode, JsValue>;
354    #[cfg(feature = "DelayNode")]
355    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createDelay")]
356    #[doc = "The `createDelay()` method."]
357    #[doc = ""]
358    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createDelay)"]
359    #[doc = ""]
360    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `DelayNode`*"]
361    pub fn create_delay(this: &AudioContext) -> Result<DelayNode, JsValue>;
362    #[cfg(feature = "DelayNode")]
363    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createDelay")]
364    #[doc = "The `createDelay()` method."]
365    #[doc = ""]
366    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createDelay)"]
367    #[doc = ""]
368    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `DelayNode`*"]
369    pub fn create_delay_with_max_delay_time(
370        this: &AudioContext,
371        max_delay_time: f64,
372    ) -> Result<DelayNode, JsValue>;
373    #[cfg(feature = "DynamicsCompressorNode")]
374    #[wasm_bindgen(
375        catch,
376        method,
377        js_class = "AudioContext",
378        js_name = "createDynamicsCompressor"
379    )]
380    #[doc = "The `createDynamicsCompressor()` method."]
381    #[doc = ""]
382    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createDynamicsCompressor)"]
383    #[doc = ""]
384    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `DynamicsCompressorNode`*"]
385    pub fn create_dynamics_compressor(
386        this: &AudioContext,
387    ) -> Result<DynamicsCompressorNode, JsValue>;
388    #[cfg(feature = "GainNode")]
389    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createGain")]
390    #[doc = "The `createGain()` method."]
391    #[doc = ""]
392    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createGain)"]
393    #[doc = ""]
394    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `GainNode`*"]
395    pub fn create_gain(this: &AudioContext) -> Result<GainNode, JsValue>;
396    #[cfg(feature = "IirFilterNode")]
397    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createIIRFilter")]
398    #[doc = "The `createIIRFilter()` method."]
399    #[doc = ""]
400    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createIIRFilter)"]
401    #[doc = ""]
402    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `IirFilterNode`*"]
403    pub fn create_iir_filter(
404        this: &AudioContext,
405        feedforward: &::wasm_bindgen::JsValue,
406        feedback: &::wasm_bindgen::JsValue,
407    ) -> Result<IirFilterNode, JsValue>;
408    #[cfg(feature = "OscillatorNode")]
409    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createOscillator")]
410    #[doc = "The `createOscillator()` method."]
411    #[doc = ""]
412    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createOscillator)"]
413    #[doc = ""]
414    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `OscillatorNode`*"]
415    pub fn create_oscillator(this: &AudioContext) -> Result<OscillatorNode, JsValue>;
416    #[cfg(feature = "PannerNode")]
417    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createPanner")]
418    #[doc = "The `createPanner()` method."]
419    #[doc = ""]
420    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPanner)"]
421    #[doc = ""]
422    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PannerNode`*"]
423    pub fn create_panner(this: &AudioContext) -> Result<PannerNode, JsValue>;
424    #[cfg(feature = "PeriodicWave")]
425    #[wasm_bindgen(
426        catch,
427        method,
428        js_class = "AudioContext",
429        js_name = "createPeriodicWave"
430    )]
431    #[doc = "The `createPeriodicWave()` method."]
432    #[doc = ""]
433    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
434    #[doc = ""]
435    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`*"]
436    pub fn create_periodic_wave(
437        this: &AudioContext,
438        real: &mut [f32],
439        imag: &mut [f32],
440    ) -> Result<PeriodicWave, JsValue>;
441    #[cfg(feature = "PeriodicWave")]
442    #[wasm_bindgen(
443        catch,
444        method,
445        js_class = "AudioContext",
446        js_name = "createPeriodicWave"
447    )]
448    #[doc = "The `createPeriodicWave()` method."]
449    #[doc = ""]
450    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
451    #[doc = ""]
452    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`*"]
453    pub fn create_periodic_wave_with_f32_array_and_f32_slice(
454        this: &AudioContext,
455        real: &::js_sys::Float32Array,
456        imag: &mut [f32],
457    ) -> Result<PeriodicWave, JsValue>;
458    #[cfg(feature = "PeriodicWave")]
459    #[wasm_bindgen(
460        catch,
461        method,
462        js_class = "AudioContext",
463        js_name = "createPeriodicWave"
464    )]
465    #[doc = "The `createPeriodicWave()` method."]
466    #[doc = ""]
467    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
468    #[doc = ""]
469    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`*"]
470    pub fn create_periodic_wave_with_f32_slice_and_f32_array(
471        this: &AudioContext,
472        real: &mut [f32],
473        imag: &::js_sys::Float32Array,
474    ) -> Result<PeriodicWave, JsValue>;
475    #[cfg(feature = "PeriodicWave")]
476    #[wasm_bindgen(
477        catch,
478        method,
479        js_class = "AudioContext",
480        js_name = "createPeriodicWave"
481    )]
482    #[doc = "The `createPeriodicWave()` method."]
483    #[doc = ""]
484    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
485    #[doc = ""]
486    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`*"]
487    pub fn create_periodic_wave_with_f32_array_and_f32_array(
488        this: &AudioContext,
489        real: &::js_sys::Float32Array,
490        imag: &::js_sys::Float32Array,
491    ) -> Result<PeriodicWave, JsValue>;
492    #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))]
493    #[wasm_bindgen(
494        catch,
495        method,
496        js_class = "AudioContext",
497        js_name = "createPeriodicWave"
498    )]
499    #[doc = "The `createPeriodicWave()` method."]
500    #[doc = ""]
501    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
502    #[doc = ""]
503    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"]
504    pub fn create_periodic_wave_with_constraints(
505        this: &AudioContext,
506        real: &mut [f32],
507        imag: &mut [f32],
508        constraints: &PeriodicWaveConstraints,
509    ) -> Result<PeriodicWave, JsValue>;
510    #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))]
511    #[wasm_bindgen(
512        catch,
513        method,
514        js_class = "AudioContext",
515        js_name = "createPeriodicWave"
516    )]
517    #[doc = "The `createPeriodicWave()` method."]
518    #[doc = ""]
519    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
520    #[doc = ""]
521    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"]
522    pub fn create_periodic_wave_with_f32_array_and_f32_slice_and_constraints(
523        this: &AudioContext,
524        real: &::js_sys::Float32Array,
525        imag: &mut [f32],
526        constraints: &PeriodicWaveConstraints,
527    ) -> Result<PeriodicWave, JsValue>;
528    #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))]
529    #[wasm_bindgen(
530        catch,
531        method,
532        js_class = "AudioContext",
533        js_name = "createPeriodicWave"
534    )]
535    #[doc = "The `createPeriodicWave()` method."]
536    #[doc = ""]
537    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
538    #[doc = ""]
539    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"]
540    pub fn create_periodic_wave_with_f32_slice_and_f32_array_and_constraints(
541        this: &AudioContext,
542        real: &mut [f32],
543        imag: &::js_sys::Float32Array,
544        constraints: &PeriodicWaveConstraints,
545    ) -> Result<PeriodicWave, JsValue>;
546    #[cfg(all(feature = "PeriodicWave", feature = "PeriodicWaveConstraints",))]
547    #[wasm_bindgen(
548        catch,
549        method,
550        js_class = "AudioContext",
551        js_name = "createPeriodicWave"
552    )]
553    #[doc = "The `createPeriodicWave()` method."]
554    #[doc = ""]
555    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createPeriodicWave)"]
556    #[doc = ""]
557    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `PeriodicWave`, `PeriodicWaveConstraints`*"]
558    pub fn create_periodic_wave_with_f32_array_and_f32_array_and_constraints(
559        this: &AudioContext,
560        real: &::js_sys::Float32Array,
561        imag: &::js_sys::Float32Array,
562        constraints: &PeriodicWaveConstraints,
563    ) -> Result<PeriodicWave, JsValue>;
564    #[cfg(feature = "ScriptProcessorNode")]
565    #[wasm_bindgen(
566        catch,
567        method,
568        js_class = "AudioContext",
569        js_name = "createScriptProcessor"
570    )]
571    #[doc = "The `createScriptProcessor()` method."]
572    #[doc = ""]
573    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
574    #[doc = ""]
575    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
576    pub fn create_script_processor(this: &AudioContext) -> Result<ScriptProcessorNode, JsValue>;
577    #[cfg(feature = "ScriptProcessorNode")]
578    #[wasm_bindgen(
579        catch,
580        method,
581        js_class = "AudioContext",
582        js_name = "createScriptProcessor"
583    )]
584    #[doc = "The `createScriptProcessor()` method."]
585    #[doc = ""]
586    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
587    #[doc = ""]
588    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
589    pub fn create_script_processor_with_buffer_size(
590        this: &AudioContext,
591        buffer_size: u32,
592    ) -> Result<ScriptProcessorNode, JsValue>;
593    #[cfg(feature = "ScriptProcessorNode")]
594    #[wasm_bindgen(
595        catch,
596        method,
597        js_class = "AudioContext",
598        js_name = "createScriptProcessor"
599    )]
600    #[doc = "The `createScriptProcessor()` method."]
601    #[doc = ""]
602    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
603    #[doc = ""]
604    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
605    pub fn create_script_processor_with_buffer_size_and_number_of_input_channels(
606        this: &AudioContext,
607        buffer_size: u32,
608        number_of_input_channels: u32,
609    ) -> Result<ScriptProcessorNode, JsValue>;
610    #[cfg(feature = "ScriptProcessorNode")]
611    #[wasm_bindgen(
612        catch,
613        method,
614        js_class = "AudioContext",
615        js_name = "createScriptProcessor"
616    )]
617    #[doc = "The `createScriptProcessor()` method."]
618    #[doc = ""]
619    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createScriptProcessor)"]
620    #[doc = ""]
621    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `ScriptProcessorNode`*"]
622    pub fn create_script_processor_with_buffer_size_and_number_of_input_channels_and_number_of_output_channels(
623        this: &AudioContext,
624        buffer_size: u32,
625        number_of_input_channels: u32,
626        number_of_output_channels: u32,
627    ) -> Result<ScriptProcessorNode, JsValue>;
628    #[cfg(feature = "StereoPannerNode")]
629    #[wasm_bindgen(
630        catch,
631        method,
632        js_class = "AudioContext",
633        js_name = "createStereoPanner"
634    )]
635    #[doc = "The `createStereoPanner()` method."]
636    #[doc = ""]
637    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createStereoPanner)"]
638    #[doc = ""]
639    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `StereoPannerNode`*"]
640    pub fn create_stereo_panner(this: &AudioContext) -> Result<StereoPannerNode, JsValue>;
641    #[cfg(feature = "WaveShaperNode")]
642    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "createWaveShaper")]
643    #[doc = "The `createWaveShaper()` method."]
644    #[doc = ""]
645    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/createWaveShaper)"]
646    #[doc = ""]
647    #[doc = "*This API requires the following crate features to be activated: `AudioContext`, `WaveShaperNode`*"]
648    pub fn create_wave_shaper(this: &AudioContext) -> Result<WaveShaperNode, JsValue>;
649    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "decodeAudioData")]
650    #[doc = "The `decodeAudioData()` method."]
651    #[doc = ""]
652    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData)"]
653    #[doc = ""]
654    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
655    pub fn decode_audio_data(
656        this: &AudioContext,
657        audio_data: &::js_sys::ArrayBuffer,
658    ) -> Result<::js_sys::Promise, JsValue>;
659    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "decodeAudioData")]
660    #[doc = "The `decodeAudioData()` method."]
661    #[doc = ""]
662    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData)"]
663    #[doc = ""]
664    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
665    pub fn decode_audio_data_with_success_callback(
666        this: &AudioContext,
667        audio_data: &::js_sys::ArrayBuffer,
668        success_callback: &::js_sys::Function,
669    ) -> Result<::js_sys::Promise, JsValue>;
670    #[wasm_bindgen(catch, method, js_class = "AudioContext", js_name = "decodeAudioData")]
671    #[doc = "The `decodeAudioData()` method."]
672    #[doc = ""]
673    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/decodeAudioData)"]
674    #[doc = ""]
675    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
676    pub fn decode_audio_data_with_success_callback_and_error_callback(
677        this: &AudioContext,
678        audio_data: &::js_sys::ArrayBuffer,
679        success_callback: &::js_sys::Function,
680        error_callback: &::js_sys::Function,
681    ) -> Result<::js_sys::Promise, JsValue>;
682    #[wasm_bindgen(catch, method, js_class = "AudioContext")]
683    #[doc = "The `resume()` method."]
684    #[doc = ""]
685    #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioContext/resume)"]
686    #[doc = ""]
687    #[doc = "*This API requires the following crate features to be activated: `AudioContext`*"]
688    pub fn resume(this: &AudioContext) -> Result<::js_sys::Promise, JsValue>;
689}