Thanks to visit codestin.com
Credit goes to docs.rs

Crate rmp3

Crate rmp3 

Source
Expand description

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};

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!
    }
}

See individual documentation on Decoder and RawDecoder for more examples.

Structs§

Audio
Describes audio samples in a frame.
Decoder
High-level streaming iterator for parsing or decoding MPEG Audio data.
DecoderOwnedstd
Exactly the same as Decoder, but owns the data. Check Decoder for examples.
RawDecoder
Low-level stateless decoder for parsing or decoding MPEG Audio data.

Enums§

Frame
Describes a frame, which contains audio samples or other data.

Constants§

MAX_SAMPLES_PER_FRAME
Maximum amount of samples that can be yielded per frame.

Type Aliases§

Sample
Conditional type used to represent one PCM sample in output data.