1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[wasm_bindgen]
6extern "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_f32_array(
69 this: &AudioBuffer,
70 destination: &::js_sys::Float32Array,
71 channel_number: i32,
72 ) -> Result<(), JsValue>;
73 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyFromChannel)]
74 #[doc = "The `copyFromChannel()` method."]
75 #[doc = ""]
76 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyFromChannel)"]
77 #[doc = ""]
78 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
79 pub fn copy_from_channel_with_start_in_channel(
80 this: &AudioBuffer,
81 destination: &mut [f32],
82 channel_number: i32,
83 start_in_channel: u32,
84 ) -> Result<(), JsValue>;
85 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyFromChannel)]
86 #[doc = "The `copyFromChannel()` method."]
87 #[doc = ""]
88 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyFromChannel)"]
89 #[doc = ""]
90 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
91 pub fn copy_from_channel_with_f32_array_and_start_in_channel(
92 this: &AudioBuffer,
93 destination: &::js_sys::Float32Array,
94 channel_number: i32,
95 start_in_channel: u32,
96 ) -> Result<(), JsValue>;
97 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel)]
98 #[doc = "The `copyToChannel()` method."]
99 #[doc = ""]
100 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)"]
101 #[doc = ""]
102 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
103 pub fn copy_to_channel(
104 this: &AudioBuffer,
105 source: &[f32],
106 channel_number: i32,
107 ) -> Result<(), JsValue>;
108 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel)]
109 #[doc = "The `copyToChannel()` method."]
110 #[doc = ""]
111 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)"]
112 #[doc = ""]
113 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
114 pub fn copy_to_channel_with_f32_array(
115 this: &AudioBuffer,
116 source: &::js_sys::Float32Array,
117 channel_number: i32,
118 ) -> Result<(), JsValue>;
119 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel)]
120 #[doc = "The `copyToChannel()` method."]
121 #[doc = ""]
122 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)"]
123 #[doc = ""]
124 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
125 pub fn copy_to_channel_with_start_in_channel(
126 this: &AudioBuffer,
127 source: &[f32],
128 channel_number: i32,
129 start_in_channel: u32,
130 ) -> Result<(), JsValue>;
131 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = copyToChannel)]
132 #[doc = "The `copyToChannel()` method."]
133 #[doc = ""]
134 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/copyToChannel)"]
135 #[doc = ""]
136 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
137 pub fn copy_to_channel_with_f32_array_and_start_in_channel(
138 this: &AudioBuffer,
139 source: &::js_sys::Float32Array,
140 channel_number: i32,
141 start_in_channel: u32,
142 ) -> Result<(), JsValue>;
143 # [wasm_bindgen (catch , method , structural , js_class = "AudioBuffer" , js_name = getChannelData)]
144 #[doc = "The `getChannelData()` method."]
145 #[doc = ""]
146 #[doc = "[MDN Documentation](https://developer.mozilla.org/en-US/docs/Web/API/AudioBuffer/getChannelData)"]
147 #[doc = ""]
148 #[doc = "*This API requires the following crate features to be activated: `AudioBuffer`*"]
149 pub fn get_channel_data(
150 this: &AudioBuffer,
151 channel: u32,
152 ) -> Result<::alloc::vec::Vec<f32>, JsValue>;
153}