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