pub struct AudioDecoderConfig {
pub codec: String,
pub description: Option<Bytes>,
pub channel_count: u32,
pub sample_rate: u32,
}
Fields§
§codec: String
The codec mimetype string.
description: Option<Bytes>
Some codec formats use a description to configure the decoder.
channel_count: u32
The number of channels in the audio.
sample_rate: u32
The sample rate of the audio.
Implementations§
Source§impl AudioDecoderConfig
impl AudioDecoderConfig
pub fn new<T: Into<String>>( codec: T, channel_count: u32, sample_rate: u32, ) -> Self
Sourcepub async fn is_supported(&self) -> Result<bool, Error>
pub async fn is_supported(&self) -> Result<bool, Error>
Check if the configuration is supported by this browser. Returns an error if the configuration is invalid, and false if just unsupported.
pub fn build(self) -> Result<(AudioDecoder, AudioDecoded), Error>
Trait Implementations§
Source§impl Clone for AudioDecoderConfig
impl Clone for AudioDecoderConfig
Source§fn clone(&self) -> AudioDecoderConfig
fn clone(&self) -> AudioDecoderConfig
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moreSource§impl Debug for AudioDecoderConfig
impl Debug for AudioDecoderConfig
Source§impl Default for AudioDecoderConfig
impl Default for AudioDecoderConfig
Source§fn default() -> AudioDecoderConfig
fn default() -> AudioDecoderConfig
Returns the “default value” for a type. Read more
Source§impl From<&AudioDecoderConfig> for AudioDecoderConfig
impl From<&AudioDecoderConfig> for AudioDecoderConfig
Source§fn from(this: &AudioDecoderConfig) -> Self
fn from(this: &AudioDecoderConfig) -> Self
Converts to this type from the input type.
Source§impl From<AudioDecoderConfig> for AudioDecoderConfig
impl From<AudioDecoderConfig> for AudioDecoderConfig
Source§fn from(this: AudioDecoderConfig) -> Self
fn from(this: AudioDecoderConfig) -> Self
Converts to this type from the input type.
Auto Trait Implementations§
impl !Freeze for AudioDecoderConfig
impl RefUnwindSafe for AudioDecoderConfig
impl Send for AudioDecoderConfig
impl Sync for AudioDecoderConfig
impl Unpin for AudioDecoderConfig
impl UnwindSafe for AudioDecoderConfig
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more