We'll start this chapter by learning how to decode an MP3 file to a format suitable to be played by the operating system using the simplemad crate, a binding for libmad.
Decoding MP3 files
Adding dependencies
Let's add the following to Cargo.toml:
crossbeam = "^0.3.0" pulse-simple = "^1.0.0" simplemad = "^0.8.1"
We also added the pulse-simple and crossbeam crates because we'll need them later. The former will be used to play the songs with pulseaudio and the latter will be used to implement the event loop of the music player engine.
We also need to add the following statements in main.rs:
extern crate crossbeam; extern crate pulse_simple; extern crate simplemad...