pub struct FlacReaderOptions {
pub metadata_only: bool,
pub read_vorbis_comment: bool,
}
Expand description
Controls what metadata FlacReader
reads when constructed.
The FLAC format contains a number of metadata blocks before the start of
audio data. Reading these is wasteful if the data is never used. The
FlacReaderOptions
indicate which blocks to look for. As soon as all
desired blocks have been read, FlacReader::new_ext()
returns without
reading remaining metadata blocks.
A few use cases:
- To read only the streaminfo, as quickly as possible, set
metadata_only
to true andread_vorbis_comment
to false. The resulting reader cannot be used to read audio data. - To read only the streaminfo and tags, set
metadata_only
andread_vorbis_comment
both to true. The resulting reader cannot be used to read audio data.
Fields§
§metadata_only: bool
When true, return a reader as soon as all desired metadata has been read.
If this is set, the FlacReader
will not be able to read audio samples.
When reading audio is not desired anyway, enabling metadata_only
can
save a lot of expensive reads.
Defaults to false.
read_vorbis_comment: bool
When true, read metadata blocks at least until a Vorbis comment block is found.
When false, the FlacReader
will be constructed without reading a
Vorbis comment block, even if the stream contains one. Consequently,
FlacReader::tags()
and other tag-related methods will not return tag
data.
Defaults to true.
Trait Implementations§
Source§impl Clone for FlacReaderOptions
impl Clone for FlacReaderOptions
Source§fn clone(&self) -> FlacReaderOptions
fn clone(&self) -> FlacReaderOptions
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more