#mp3 #audio #decoder #mpeg #media

minimp3

Rust bindings for the minimp3 library

5 unstable releases

0.3.2 Dec 8, 2018
0.3.1 Dec 7, 2018
0.3.0 Jun 21, 2018
0.2.0 Jun 15, 2018
0.1.0 Jan 31, 2018

#4 in Audio

Download history 693/week @ 2018-10-11 1151/week @ 2018-10-18 673/week @ 2018-10-25 695/week @ 2018-11-01 601/week @ 2018-11-08 1180/week @ 2018-11-15 834/week @ 2018-11-22 1034/week @ 2018-11-29 821/week @ 2018-12-06 1741/week @ 2018-12-13 898/week @ 2018-12-20 921/week @ 2018-12-27 980/week @ 2019-01-03

4,121 downloads per month
Used in 2 crates

MIT license

57KB
928 lines

minimp3 Rust bindings

Cargo package Cargo package Build Status

Usage example

# Cargo.toml

[dependencies]
minimp3 = "0.3"
extern crate minimp3;

use minimp3::{Decoder, Frame, Error};

use std::fs::File;

fn main() {
    let mut decoder = Decoder::new(File::open("audio_file.mp3").unwrap());

    loop {
        match decoder.next_frame() {
            Ok(Frame { data, sample_rate, channels, .. }) => {
                println!("Decoded {} samples", data.len() / channels)
            },
            Err(Error::Eof) => break,
            Err(e) => panic!("{:?}", e),
        }
    }
}

Dependencies

~1MB
~10K SLoC