#![allow(unused_imports)]
#![allow(clippy::all)]
use super::*;
use wasm_bindgen::prelude::*;
#[cfg(web_sys_unstable_apis)]
#[wasm_bindgen]
extern "C" {
# [wasm_bindgen (extends = :: js_sys :: Object , js_name = AudioEncoderConfig)]
#[derive(Debug, Clone, PartialEq, Eq)]
#[doc = "The `AudioEncoderConfig` dictionary."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub type AudioEncoderConfig;
#[wasm_bindgen(method, setter = "bitrate")]
fn bitrate_shim(this: &AudioEncoderConfig, val: f64);
#[wasm_bindgen(method, setter = "codec")]
fn codec_shim(this: &AudioEncoderConfig, val: &str);
#[wasm_bindgen(method, setter = "numberOfChannels")]
fn number_of_channels_shim(this: &AudioEncoderConfig, val: u32);
#[wasm_bindgen(method, setter = "sampleRate")]
fn sample_rate_shim(this: &AudioEncoderConfig, val: u32);
}
#[cfg(web_sys_unstable_apis)]
impl AudioEncoderConfig {
#[doc = "Construct a new `AudioEncoderConfig`."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn new(codec: &str) -> Self {
#[allow(unused_mut)]
let mut ret: Self = ::wasm_bindgen::JsCast::unchecked_into(::js_sys::Object::new());
ret.codec(codec);
ret
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `bitrate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn bitrate(&mut self, val: f64) -> &mut Self {
self.bitrate_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `codec` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn codec(&mut self, val: &str) -> &mut Self {
self.codec_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `numberOfChannels` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn number_of_channels(&mut self, val: u32) -> &mut Self {
self.number_of_channels_shim(val);
self
}
#[cfg(web_sys_unstable_apis)]
#[doc = "Change the `sampleRate` field of this object."]
#[doc = ""]
#[doc = "*This API requires the following crate features to be activated: `AudioEncoderConfig`*"]
#[doc = ""]
#[doc = "*This API is unstable and requires `--cfg=web_sys_unstable_apis` to be activated, as"]
#[doc = "[described in the `wasm-bindgen` guide](https://rustwasm.github.io/docs/wasm-bindgen/web-sys/unstable-apis.html)*"]
pub fn sample_rate(&mut self, val: u32) -> &mut Self {
self.sample_rate_shim(val);
self
}
}