simplemad is a simple interface for libmad, the MPEG audio decoding library.
Use and examples
To begin, create a Decoder
from a byte-oriented source using
Decoder::decode
or Decoder::decode_interval
. Fetch results using
get_frame
or the Iterator
interface.
MP3 files often begin with metadata, which will cause libmad to produce errors. It is safe to ignore these errors until libmad reaches audio data and starts producing frames.
use ;
use File;
use Path;
let path = new;
let file = open.unwrap;
let decoder = decode.unwrap;
for decoding_result in decoder
Decode the interval from 30 seconds to 60 seconds:
let mut partial_decoder = decode_interval.unwrap;
libmad
On Linux, libmad will be built automatically, if it is not installed. On other operating systems, it is necessary to install libmad manually. Links to libmad can be found below. If you are building from source, you will also need to apply the patch found in this guide.
Documentation
http://bendykst.github.io/doc/simplemad/index.html
Dependencies
-
libmad (FTP: ftp://ftp.mars.org/pub/mpeg/ or SourceForge)
-
libc
License
MIT