rmp3 0.3.1

fast & safe no_std minimp3 wrapper
Documentation

Idiomatic no_std bindings to minimp3 which don't allocate.

Features

  • float: Changes the type of [Sample] 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 (default): Adds things that require std, right now that's just [DecoderOwned] for owned data on the heap.

Example

use rmp3::{Decoder, Frame};

# fn main() -> Result<(), Box<dyn std::error::Error>> {
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!
}
}
# Ok(())
# }

See individual documentation on [Decoder] and [RawDecoder] for more examples.