Struct flac::stream::Stream
[−]
[src]
pub struct Stream<P: StreamProducer> { /* fields omitted */ }
FLAC stream that decodes and hold file information.
Methods
impl<P> Stream<P> where
P: StreamProducer,
[src]
P: StreamProducer,
fn new<R: Read>(reader: R) -> Result<StreamReader<R>, ErrorKind>
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>, ErrorKind>
Constructs a decoder with the given file name.
Failures
ErrorKind::IO(io::ErrorKind::NotFound)
is returned when the given filename isn't found.ErrorKind::IO(io::ErrorKind::InvalidData)
is returned when the data within the file isn't valid FLAC data.- Several different parser specific errors that are structured as
ErrorKind::<parser_name>Parser
. - Several different invalidation specific errors that are
structured as
ErrorKind::Invalid<invalidation_name>
.
fn from_buffer(buffer: &[u8]) -> Result<StreamBuffer, ErrorKind>
Constructs a decoder with the given buffer.
This constructor assumes that an entire FLAC file is in the buffer.
Failures
ErrorKind::IO(io::ErrorKind::InvalidData)
is returned when the data within the file isn't valid FLAC data.- Several different parser specific errors that are structured as
ErrorKind::<parser_name>Parser
. - Several different invalidation specific errors that are
structured as
ErrorKind::Invalid<invalidation_name>
.
fn iter<S: SampleSize>(&mut self) -> Iter<P, S::Extended>
Returns an iterator over the decoded samples.