Skip to content
Rust bindings for sdl2_mixer
Rust
Branch: master
Clone or download
Pull request Compare This branch is 1 commit ahead, 129 commits behind andelf:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
src
.gitignore
.travis.yml
Cargo.toml
LICENSE
README.md

README.md

Rust-SDL2_mixer

Build Status

Rust bindings for SDL2_mixer.

Overview

Rust-SDL2_mixer is a library for talking to the new SDL2_mixer library from Rust.

Rust-SDL2_mixer uses the MIT licence.

Requirements

  • Rust-SDL2
  • SDL2_mixer development libraries
  • Rust master or nightly

Installation

Place the following into your project's Cargo.toml file:

[dependencies]
sdl2_mixer = "0.0.31" # Doesn't work yet, needs to be published.

Or, to depend on the newest rust-sdl2_mixer, reference the repository:

[dependencies.sdl2_mixer]
git = "https://github.com/andelf/rust-sdl2_mixer"

You can also just clone and build the library yourself:

git clone https://github.com/andelf/rust-sdl2_mixer
cd rust-sdl2_mixer
cargo build
# TODO: OR if you are using the mac framework version
rustc --cfg mac_framework src/sdl2_mixer/lib.rs

If you're not using Cargo, you can compile the library manually:

git clone https://github.com/andelf/rust-sdl2_mixer
cd rust-sdl2_mixer
rustc src/sdl2_mixer/lib.rs

Demo

A simple demo that plays out a portion of a given music file is included:

cargo run path/to/music.(mp3|flac|ogg|wav)

Or:

rustc -L. src/demo/main.rs -o demo
./demo path/to/music.(mp3|flac|ogg|wav)
You can’t perform that action at this time.