Struct lewton::inside_ogg::OggStreamReader[][src]

pub struct OggStreamReader<T: Read + Seek> {
    pub ident_hdr: IdentHeader,
    pub comment_hdr: CommentHeader,
    pub setup_hdr: SetupHeader,
    // some fields omitted
}

Reading ogg/vorbis files or streams

This is a small helper struct to help reading ogg/vorbis files or streams in that format.

It only supports the main use case of pure audio ogg files streams. Reading a file where vorbis is only one of multiple streams, like in the case of ogv, is not supported.

If you need support for this, you need to use the lower level methods instead.

Fields

Methods

impl<T: Read + Seek> OggStreamReader<T>
[src]

Constructs a new OggStreamReader from a given implementation of Read + Seek.

Please note that this function doesn't work well with async I/O. In order to support this use case, enable the async_ogg feature, and use the HeadersReader struct instead.

Constructs a new OggStreamReader from a given Ogg PacketReader.

The new function is a nice wrapper around this function that also creates the ogg reader.

Please note that this function doesn't work well with async I/O. In order to support this use case, enable the async_ogg feature, and use the HeadersReader struct instead.

Reads and decompresses an audio packet from the stream.

On read errors, it returns Err(e) with the error.

On success, it either returns None, when the end of the stream has been reached, or Some(packet_data), with the data of the decompressed packet.

Reads and decompresses an audio packet from the stream (interleaved).

On read errors, it returns Err(e) with the error.

On success, it either returns None, when the end of the stream has been reached, or Some(packet_data), with the data of the decompressed packet.

Unlike read_dec_packet, this function returns the interleaved samples.

Returns the absolute granule position of the last read page.

In the case of ogg/vorbis, the absolute granule position is given as number of PCM samples, on a per channel basis.

Seeks to the specified absolute granule position, with a page granularity.

The granularity is per-page, and the obtained position is then <= the seeked absgp.

In the case of ogg/vorbis, the absolute granule position is given as number of PCM samples, on a per channel basis.

Auto Trait Implementations

impl<T> Send for OggStreamReader<T> where
    T: Send

impl<T> Sync for OggStreamReader<T> where
    T: Sync