Struct claxon::FlacReaderOptions[][src]

pub struct FlacReaderOptions {
    pub metadata_only: bool,
    pub read_vorbis_comment: bool,
}

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 and read_vorbis_comment to false. The resulting reader cannot be used to read audio data.
  • To read only the streaminfo and tags, set metadata_only and read_vorbis_comment both to true. The resulting reader cannot be used to read audio data.

Fields

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.

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

impl Copy for FlacReaderOptions
[src]

impl Clone for FlacReaderOptions
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl Debug for FlacReaderOptions
[src]

Formats the value using the given formatter. Read more

impl Eq for FlacReaderOptions
[src]

impl PartialEq for FlacReaderOptions
[src]

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

impl Default for FlacReaderOptions
[src]

Returns the "default value" for a type. Read more

Auto Trait Implementations