#mp3 #audio #decoder #mpeg #media

minimp3

Rust bindings for the minimp3 library

6 releases

0.3.3 May 8, 2019
0.3.2 Dec 8, 2018
0.3.0 Jun 21, 2018
0.2.0 Jun 15, 2018
0.1.0 Jan 31, 2018

#10 in Audio

Download history 1530/week @ 2019-01-23 1613/week @ 2019-01-30 1320/week @ 2019-02-06 1541/week @ 2019-02-13 1217/week @ 2019-02-20 1277/week @ 2019-02-27 1409/week @ 2019-03-06 1549/week @ 2019-03-13 1493/week @ 2019-03-20 1746/week @ 2019-03-27 1862/week @ 2019-04-03 1752/week @ 2019-04-10 1953/week @ 2019-04-17 1204/week @ 2019-04-24 1117/week @ 2019-05-01

6,425 downloads per month
Used in 5 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