Function ogg_metadata::read_format [] [src]

pub fn read_format<'a, T: Read + Seek + 'a>(
    rdr: T
) -> Result<Vec<OggFormat>, OggMetadataError>

Reads the format of the file.

The read process is optimized for detecting the format without performing a full read of the file. Instead it guesses when a file may contain more than just one logical stream, and even then only scans as much as it needs.

This is not 100% correct, as the Ogg physical bitstream may contain further logical bitstreams that contain further data, but if we wanted to be 100% correct, we'd have to scan the entire file. This may be okay for files stored on disk, but if a file is behind a slow internet connection, users expect playback to work even if only a small part is downloaded.

The approach taken works perfectly with ogg/vorbis and ogg/opus files, as those only contain one logical bitstream.