Struct flac::stream::Stream
[−]
[src]
pub struct Stream<P: StreamProducer> { // some fields omitted }
FLAC stream that decodes and hold file information.
Methods
impl<P> Stream<P> where P: StreamProducer
[src]
fn new<R: Read>(reader: R) -> Result<StreamReader<R>>
Constructor for the default state of a FLAC stream.
fn info(&self) -> StreamInfo
Returns information for the current stream.
fn metadata(&self) -> &[Metadata]
Returns a slice of Metadata
This slice excludes StreamInfo
, which is located in Stream::info
.
Everything else is related to metadata for the FLAC stream is in the
slice.
fn from_file(filename: &str) -> Result<StreamReader<File>>
Constructs a decoder with the given file name.
Failures
ErrorKind::NotFound
is returned when the given filename isn't found.ErrorKind::InvalidData
is returned when the data within the file isn't valid FLAC data.
fn from_buffer(buffer: &[u8]) -> Result<StreamBuffer>
Constructs a decoder with the given buffer.
This constructor assumes that an entire FLAC file is in the buffer.
Failures
ErrorKind::InvalidData
is returned when the data within the buffer isn't valid FLAC data.
fn iter(&mut self) -> Iter<P>
Returns an iterator over the decoded samples.