1 | #![allow (unused_imports)] |
2 | #![allow (clippy::all)] |
3 | use super::*; |
4 | use wasm_bindgen::prelude::*; |
5 | #[wasm_bindgen ] |
6 | extern "C" { |
7 | # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioBuffer , typescript_type = "AudioBuffer" )] |
8 | #[derive (Debug, Clone, PartialEq, Eq)] |
9 | #[doc = "The `AudioBuffer` class." ] |
10 | #[doc = "" ] |
11 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer)" ] |
12 | #[doc = "" ] |
13 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
14 | pub type AudioBuffer; |
15 | # [wasm_bindgen (structural , method , getter , js_class = "AudioBuffer" , js_name = sampleRate)] |
16 | #[doc = "Getter for the `sampleRate` field of this object." ] |
17 | #[doc = "" ] |
18 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/sampleRate)" ] |
19 | #[doc = "" ] |
20 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
21 | pub fn sample_rate(this: &AudioBuffer) -> f32; |
22 | # [wasm_bindgen (structural , method , getter , js_class = "AudioBuffer" , js_name = length)] |
23 | #[doc = "Getter for the `length` field of this object." ] |
24 | #[doc = "" ] |
25 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/length)" ] |
26 | #[doc = "" ] |
27 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
28 | pub fn length(this: &AudioBuffer) -> u32; |
29 | # [wasm_bindgen (structural , method , getter , js_class = "AudioBuffer" , js_name = duration)] |
30 | #[doc = "Getter for the `duration` field of this object." ] |
31 | #[doc = "" ] |
32 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/duration)" ] |
33 | #[doc = "" ] |
34 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
35 | pub fn duration(this: &AudioBuffer) -> f64; |
36 | # [wasm_bindgen (structural , method , getter , js_class = "AudioBuffer" , js_name = numberOfChannels)] |
37 | #[doc = "Getter for the `numberOfChannels` field of this object." ] |
38 | #[doc = "" ] |
39 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/numberOfChannels)" ] |
40 | #[doc = "" ] |
41 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
42 | pub fn number_of_channels(this: &AudioBuffer) -> u32; |
43 | #[cfg (feature = "AudioBufferOptions" )] |
44 | #[wasm_bindgen (catch, constructor, js_class = "AudioBuffer" )] |
45 | #[doc = "The `new AudioBuffer(..)` constructor, creating a new instance of `AudioBuffer`." ] |
46 | #[doc = "" ] |
47 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/AudioBuffer)" ] |
48 | #[doc = "" ] |
49 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`, `AudioBufferOptions`*" ] |
50 | pub fn new(options: &AudioBufferOptions) -> Result<AudioBuffer, JsValue>; |
51 | # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyFromChannel)] |
52 | #[doc = "The `copyFromChannel()` method." ] |
53 | #[doc = "" ] |
54 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyFromChannel)" ] |
55 | #[doc = "" ] |
56 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
57 | pub fn copy_from_channel( |
58 | this: &AudioBuffer, |
59 | destination: &mut [f32], |
60 | channel_number: i32, |
61 | ) -> Result<(), JsValue>; |
62 | # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyFromChannel)] |
63 | #[doc = "The `copyFromChannel()` method." ] |
64 | #[doc = "" ] |
65 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyFromChannel)" ] |
66 | #[doc = "" ] |
67 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
68 | pub fn copy_from_channel_with_start_in_channel( |
69 | this: &AudioBuffer, |
70 | destination: &mut [f32], |
71 | channel_number: i32, |
72 | start_in_channel: u32, |
73 | ) -> Result<(), JsValue>; |
74 | # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel)] |
75 | #[doc = "The `copyToChannel()` method." ] |
76 | #[doc = "" ] |
77 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)" ] |
78 | #[doc = "" ] |
79 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
80 | pub fn copy_to_channel( |
81 | this: &AudioBuffer, |
82 | source: &[f32], |
83 | channel_number: i32, |
84 | ) -> Result<(), JsValue>; |
85 | # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel)] |
86 | #[doc = "The `copyToChannel()` method." ] |
87 | #[doc = "" ] |
88 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)" ] |
89 | #[doc = "" ] |
90 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
91 | pub fn copy_to_channel_with_start_in_channel( |
92 | this: &AudioBuffer, |
93 | source: &[f32], |
94 | channel_number: i32, |
95 | start_in_channel: u32, |
96 | ) -> Result<(), JsValue>; |
97 | # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = getChannelData)] |
98 | #[doc = "The `getChannelData()` method." ] |
99 | #[doc = "" ] |
100 | #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/getChannelData)" ] |
101 | #[doc = "" ] |
102 | #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*" ] |
103 | pub fn get_channel_data(this: &AudioBuffer, channel: u32) -> Result<Vec<f32>, JsValue>; |
104 | } |
105 | |