Rust bindings for SDL2_mixer.
Rust-SDL2mixer is a library for talking to the new SDL2mixer library from Rust.
Rust-SDL2_mixer uses the MIT licence.
Place the following into your project's Cargo.toml file:
toml
[dependencies]
sdl2_mixer = "0.2.1"
Or, to depend on the newest rust-sdl2_mixer, reference the repository:
toml
[dependencies.sdl2_mixer]
git = "https://github.com/andelf/rust-sdl2_mixer"
You can also just clone and build the library yourself:
```bash git clone https://github.com/andelf/rust-sdl2mixer cd rust-sdl2mixer cargo build
rustc --cfg macframework src/sdl2mixer/lib.rs ```
If you're not using Cargo, you can compile the library manually:
bash
git clone https://github.com/andelf/rust-sdl2_mixer
cd rust-sdl2_mixer
rustc src/sdl2_mixer/lib.rs
A simple demo that plays out a portion of a given music file is included:
bash
cargo run path/to/music.(mp3|flac|ogg|wav)
Or:
bash
rustc -L. src/demo/main.rs -o demo
./demo path/to/music.(mp3|flac|ogg|wav)