Crate puremp3

Source
Expand description

An MP3 decoder implemented in pure Rust.

Supports MPEG-1, MPEG-2, and MPEG-2.5 Layer III streams. Layers I and II are currently unsupported.

§Example

let data = std::fs::read("tests/vectors/MonoCBR192.mp3").expect("Could not open file");
let (header, samples) = puremp3::read_mp3(&data[..]).expect("Invalid MP3");
for (left, right) in samples {
    // Operate on samples here
}

Structs§

Frame
A frame of MP3 data.
FrameHeader
Header of an MP3 frame.
Mp3Decoder
Decodes MP3 streams.

Enums§

BitRate
The bit rate of an MP3 stream.
Channels
The channel mode
Emphasis
Emphasis used in encoding an MP3 audio stream.
Error
Error that can be raised during MP3 decoding.
Mp3Error
MpegLayer
The MPEG Layer used in encoding audio.
MpegVersion
The version of the MPEG standard used in encoding audio.
SampleRate
The sample rate of an MP3 stream.

Functions§

read_mp3
Convenience method to decode an MP3. Returns the first frame header found in the MP3, and an Iterator that yields MP3 Samples`.