simplemad is a simple interface for libmad, the MPEG audio decoding library. simplemad is useful for those who need to decode MP3 or other MPEG audio files in full.
Use
Create a Decoder from a Reader.
let path = new;
let file = open.unwrap;
let decoder = new;
Decoder implements Iterator and yields a sequence of Result<Frame, MadError>.
for item in decoder
libmad samples are signed 32-bit integers. MP3 files often begin with metadata, which will cause libmad to complain. It is safe to ignore errors until libmad reaches audio data and starts producing frames.
Installation
First, install libmad. Links to the source can be found below. It might be necessary to apply the patch found in this guide. Then add simplemad = "0.2.1" to the list of dependencies in your Cargo.toml.
Documentation
TODO
Dependencies
-
libmad (FTP: ftp://ftp.mars.org/pub/mpeg/ or SourceForge)
-
libc
License
MIT