#decoder #minimp3 #decoding #wrapper #mp3 #simd #std

no-std rmp3

fast & safe no_std minimp3 wrapper

5 unstable releases

0.3.1 Feb 23, 2021
0.3.0 Feb 15, 2021
0.2.1 Jan 21, 2020
0.2.0 Jan 21, 2020
0.1.0 Jan 21, 2020

#688 in Audio

Download history 26/week @ 2024-07-15 12/week @ 2024-07-22 16/week @ 2024-07-29 24/week @ 2024-08-05 13/week @ 2024-08-12 7/week @ 2024-08-19 28/week @ 2024-08-26 12/week @ 2024-09-02 23/week @ 2024-09-09 25/week @ 2024-09-23 44/week @ 2024-09-30 22/week @ 2024-10-07 19/week @ 2024-10-14 27/week @ 2024-10-21 12/week @ 2024-10-28

87 downloads per month
Used in 2 crates

CC0 license

31KB
480 lines

Build Status (Travis-CI) Crates.io Documentation

rmp3

Idiomatic no_std bindings to minimp3 which don't allocate.

Documentation

The documentation is hosted online over at docs.rs.

Usage

Add this to your Cargo.toml:

[dependencies]
rmp3 = "0.3"

... or, if you need std specific features:

[dependencies]
rmp3 = { features = ["std"], version = "0.3" }

The most basic example is using the provided streaming iterator to decode a file, like so:

use rmp3::{Decoder, Frame};

let mp3 = std::fs::read("test.mp3")?;
let mut decoder = Decoder::new(&mp3);
while let Some(frame) = decoder.next() {
    if let Frame::Audio(audio) = frame {
        // process audio frame here!
        imaginary_player.append(
            audio.channels(),
            audio.sample_count(),
            audio.sample_rate(),
            audio.samples(),
        );
    }
}

Check out the documentation for more examples and info.

Features

  • float: Changes the sample type to a single-precision float, and thus decoders will output float PCM.
    • This is a non-additive feature and will change API. Do not do this in a library without notice (why?).
  • mp1-mp2: Includes MP1 and MP2 decoding code.
  • simd (default): Enables handwritten SIMD optimizations on eligible targets.
  • std: Adds things that require std,

Dependencies

~0.4–325KB