web_sys/features/
gen_AudioEncoderConfig.rs1#![allow(unused_imports)]
2#![allow(clippy::all)]
3use super::*;
4use wasm_bindgen::prelude::*;
5#[cfg(web_sys_unstable_apis)]
6#[wasm_bindgen]
7extern "C" {
8 # [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioEncoderConfig)]
9 #[derive(Debug, Clone, PartialEq, Eq)]
10 #[doc = "The `AudioEncoderConfig` dictionary."]
11 #[doc = ""]
12 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
13 #[doc = ""]
14 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
15 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
16 pub type AudioEncoderConfig;
17 #[cfg(web_sys_unstable_apis)]
18 #[doc = "Get the `bitrate` field of this object."]
19 #[doc = ""]
20 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
21 #[doc = ""]
22 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
23 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
24 #[wasm_bindgen(method, getter = "bitrate")]
25 pub fn get_bitrate(this: &AudioEncoderConfig) -> Option<f64>;
26 #[cfg(web_sys_unstable_apis)]
27 #[doc = "Change the `bitrate` field of this object."]
28 #[doc = ""]
29 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
30 #[doc = ""]
31 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
32 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
33 #[wasm_bindgen(method, setter = "bitrate")]
34 pub fn set_bitrate(this: &AudioEncoderConfig, val: f64);
35 #[cfg(web_sys_unstable_apis)]
36 #[doc = "Get the `codec` field of this object."]
37 #[doc = ""]
38 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
39 #[doc = ""]
40 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
41 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
42 #[wasm_bindgen(method, getter = "codec")]
43 pub fn get_codec(this: &AudioEncoderConfig) -> ::alloc::string::String;
44 #[cfg(web_sys_unstable_apis)]
45 #[doc = "Change the `codec` field of this object."]
46 #[doc = ""]
47 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
48 #[doc = ""]
49 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
50 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
51 #[wasm_bindgen(method, setter = "codec")]
52 pub fn set_codec(this: &AudioEncoderConfig, val: &str);
53 #[cfg(web_sys_unstable_apis)]
54 #[doc = "Get the `numberOfChannels` field of this object."]
55 #[doc = ""]
56 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
57 #[doc = ""]
58 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
59 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
60 #[wasm_bindgen(method, getter = "numberOfChannels")]
61 pub fn get_number_of_channels(this: &AudioEncoderConfig) -> Option<u32>;
62 #[cfg(web_sys_unstable_apis)]
63 #[doc = "Change the `numberOfChannels` field of this object."]
64 #[doc = ""]
65 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
66 #[doc = ""]
67 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
68 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
69 #[wasm_bindgen(method, setter = "numberOfChannels")]
70 pub fn set_number_of_channels(this: &AudioEncoderConfig, val: u32);
71 #[cfg(web_sys_unstable_apis)]
72 #[doc = "Get the `sampleRate` field of this object."]
73 #[doc = ""]
74 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
75 #[doc = ""]
76 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
77 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
78 #[wasm_bindgen(method, getter = "sampleRate")]
79 pub fn get_sample_rate(this: &AudioEncoderConfig) -> Option<u32>;
80 #[cfg(web_sys_unstable_apis)]
81 #[doc = "Change the `sampleRate` field of this object."]
82 #[doc = ""]
83 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
84 #[doc = ""]
85 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
86 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
87 #[wasm_bindgen(method, setter = "sampleRate")]
88 pub fn set_sample_rate(this: &AudioEncoderConfig, val: u32);
89}
90#[cfg(web_sys_unstable_apis)]
91impl AudioEncoderConfig {
92 #[doc = "Construct a new `AudioEncoderConfig`."]
93 #[doc = ""]
94 #[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
95 #[doc = ""]
96 #[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
97 #[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
98 pub fn new(codec: &str) -> Self {
99 #[allow(unused_mut)]
100 let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
101 ret.set_codec(codec);
102 ret
103 }
104 #[cfg(web_sys_unstable_apis)]
105 #[deprecated = "Use `set_bitrate()` instead."]
106 pub fn bitrate(&mut self, val: f64) -> &mut Self {
107 self.set_bitrate(val);
108 self
109 }
110 #[cfg(web_sys_unstable_apis)]
111 #[deprecated = "Use `set_codec()` instead."]
112 pub fn codec(&mut self, val: &str) -> &mut Self {
113 self.set_codec(val);
114 self
115 }
116 #[cfg(web_sys_unstable_apis)]
117 #[deprecated = "Use `set_number_of_channels()` instead."]
118 pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
119 self.set_number_of_channels(val);
120 self
121 }
122 #[cfg(web_sys_unstable_apis)]
123 #[deprecated = "Use `set_sample_rate()` instead."]
124 pub fn sample_rate(&mut self, val: u32) -> &mut Self {
125 self.set_sample_rate(val);
126 self
127 }
128}