Expand description
An implementation of FLAC, free lossless audio codec, written in Rust.
The code is available on GitHub.
§Examples
Basic decoding from a file.
use flac::StreamReader;
use std::fs::File;
match StreamReader::<File>::from_file("path/to/file.flac") {
Ok(mut stream) => {
// Copy of `StreamInfo` to help convert to a different audio format.
let info = stream.info();
// The explicit size for `Stream::iter` is the resulting decoded
// sample. You can usually find out the desired size of the
// samples with `info.bits_per_sample`.
for sample in stream.iter::<i16>() {
// Iterate over each decoded sample
}
}
Err(error) => println!("{:?}", error),
}
Re-exports§
pub use metadata::Metadata;
pub use stream::Stream;
pub use stream::StreamBuffer;
pub use stream::StreamReader;
Modules§
Structs§
- Byte
Stream - Structure that hold a slice of bytes.
- Read
Stream - Structure that hold a reader for a source of bytes.
Enums§
- Error
Kind - Represent the different kinds of errors.
Traits§
- Sample
- An abstraction trait for keeping different sized integers.
- Sample
Size - A trait for defining the size of a sample.
- Stream
Producer - An interface for parsing through some type of producer to a byte stream.