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§
Sourcefn channel_count(&self) -> u8
fn channel_count(&self) -> u8
Returns channel count
From 1 to 8
Sourcefn sample_rate(&self) -> u32
fn sample_rate(&self) -> u32
Returns sample rate, in Hz
Sourcefn bits_per_sample(&self) -> u32
fn bits_per_sample(&self) -> u32
Returns decoder’s bits-per-sample
From 1 to 32
Provided Methods§
Sourcefn channel_mask(&self) -> ChannelMask
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
Sourcefn total_samples(&self) -> Option<u64>
fn total_samples(&self) -> Option<u64>
Returns total number of channel-independent samples, if known
Sourcefn md5(&self) -> Option<&[u8; 16]>
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.
Sourcefn decoded_len(&self) -> Option<u64>
fn decoded_len(&self) -> Option<u64>
Returns total length of decoded file, in bytes