Trait Metadata

Source
pub trait Metadata {
    // Required methods
    fn channel_count(&self) -> u8;
    fn sample_rate(&self) -> u32;
    fn bits_per_sample(&self) -> u32;

    // Provided methods
    fn channel_mask(&self) -> ChannelMask { ... }
    fn total_samples(&self) -> Option<u64> { ... }
    fn md5(&self) -> Option<&[u8; 16]> { ... }
    fn decoded_len(&self) -> Option<u64> { ... }
    fn duration(&self) -> Option<Duration> { ... }
}
Expand description

A trait for indicating various pieces of FLAC stream metadata

This metadata may be necessary for decoding a FLAC file to some other container or an output stream.

Required Methods§

Source

fn channel_count(&self) -> u8

Returns channel count

From 1 to 8

Source

fn sample_rate(&self) -> u32

Returns sample rate, in Hz

Source

fn bits_per_sample(&self) -> u32

Returns decoder’s bits-per-sample

From 1 to 32

Provided Methods§

Source

fn channel_mask(&self) -> ChannelMask

Returns channel mask

This uses the channel mask defined in the Vorbis comment, if found, or defaults to FLAC’s default channel assignment if not

Source

fn total_samples(&self) -> Option<u64>

Returns total number of channel-independent samples, if known

Source

fn md5(&self) -> Option<&[u8; 16]>

Returns MD5 of entire stream, if known

MD5 is always calculated in terms of little-endian, signed, byte-aligned values.

Source

fn decoded_len(&self) -> Option<u64>

Returns total length of decoded file, in bytes

Source

fn duration(&self) -> Option<Duration>

Returns duration of file

Implementors§