Skip to main content

OpusHeader

Struct OpusHeader 

Source
pub struct OpusHeader {
    pub version: u8,
    pub channels: ChannelMapping,
    pub pre_skip: u16,
    pub sample_rate: u32,
    pub output_gain: u16,
}
Expand description

Opus header data.

Fields§

§version: u8

Opus version.

§channels: ChannelMapping

Channel mapping.

§pre_skip: u16

The number of samples to skip in the beginning of the stream.

§sample_rate: u32

Sample rate used for the original audio.

§output_gain: u16

Output gain.

Implementations§

Source§

impl OpusHeader

Source

pub fn parse(input: &[u8]) -> Result<'_, Self>

Parse opus header from input data.

May return UnsupportedStream if family255 feature has not been enabled and such stream is encountered.

Trait Implementations§

Source§

impl Debug for OpusHeader

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl PartialEq for OpusHeader

Source§

fn eq(&self, other: &OpusHeader) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for OpusHeader

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.