pub struct OpusHead {
pub version: u8,
pub channel_count: u8,
pub pre_skip: u16,
pub input_sample_rate: u32,
pub output_gain_q8: i16,
pub channel_mapping: ChannelMapping,
}Expand description
The identification header of an Ogg Opus stream (RFC 7845 §5.1).
Fields§
§version: u8Encapsulation version; 1 for this specification, with the upper four
bits as a compatible major version.
channel_count: u8Output channel count C; never zero.
pre_skip: u16Samples (at 48 kHz) to discard from decoder output at startup, and the offset subtracted from granule positions to obtain PCM positions.
input_sample_rate: u32Sample rate of the original input in Hz - metadata only, not the playback rate. Zero means unspecified.
output_gain_q8: i16Output gain in Q7.8 dB, applied by players on top of decoder output.
channel_mapping: ChannelMappingStream-to-channel mapping.
Implementations§
Source§impl OpusHead
impl OpusHead
Sourcepub fn parse(data: &[u8]) -> Result<Self, OggOpusError>
pub fn parse(data: &[u8]) -> Result<Self, OggOpusError>
Parses an OpusHead packet.
§Errors
OggOpusError::InvalidIdHeader for structural problems;
OggOpusError::UnsupportedVersion when the major version is not 0
(i.e., the version octet is 16 or greater).
Trait Implementations§
impl Eq for OpusHead
impl StructuralPartialEq for OpusHead
Auto Trait Implementations§
impl Freeze for OpusHead
impl RefUnwindSafe for OpusHead
impl Send for OpusHead
impl Sync for OpusHead
impl Unpin for OpusHead
impl UnsafeUnpin for OpusHead
impl UnwindSafe for OpusHead
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