#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 809/week @ 2018-11-17 1039/week @ 2018-11-24 993/week @ 2018-12-01 1587/week @ 2018-12-08 991/week @ 2018-12-15 833/week @ 2018-12-22 1115/week @ 2018-12-29 1393/week @ 2019-01-05 1531/week @ 2019-01-12 1291/week @ 2019-01-19 1690/week @ 2019-01-26 1326/week @ 2019-02-02 1314/week @ 2019-02-09 1642/week @ 2019-02-16 1235/week @ 2019-02-23

4,121 downloads per month
Used in 4 crates (3 directly)

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