andelf / rust-sdl2_mixer

Rust bindings for sdl2_mixer
Apache License 2.0
13 stars 17 forks source link

Cannot run demo on OSX using Homebrew #59

Closed johnthagen closed 7 years ago

johnthagen commented 7 years ago

When I try to play a simple WAV file on OSX using the demo example I receive the following output:

/Users/hagenjt1/.cargo/bin/cargo run --example demo piano.wav
   Compiling sdl2_mixer v0.24.0 (file:///Users/hagenjt1/GitHub/rust-sdl2_mixer)
    Finished debug [unoptimized + debuginfo] target(s) in 0.44 secs
     Running `target/debug/examples/demo piano.wav`
linked version: 2.0.1
thread 'main' panicked at 'called `Result::unwrap()` on an `Err` value: "Mixer not built with Ogg Vorbis support"', ../src/libcore/result.rs:788
note: Run with `RUST_BACKTRACE=1` for a backtrace.
error: Process didn't exit successfully: `target/debug/examples/demo piano.wav` (exit code: 101)

Process finished with exit code 101

I've brew installed the following packages:

brew list --versions
sdl2 2.0.4
sdl2_mixer 2.0.1

Was there some kind of configuration step I've missed?

Environment:

andelf commented 7 years ago

Can you post your brew info sdl2_mixer

johnthagen commented 7 years ago
$ brew info sdl2_mixer
sdl2_mixer: stable 2.0.1 (bottled), HEAD
Sample multi-channel audio mixer library
https://www.libsdl.org/projects/SDL_mixer/
/usr/local/Cellar/sdl2_mixer/2.0.1 (9 files, 378.2K) *
  Poured from bottle on 2016-10-23 at 20:25:11
From: https://github.com/Homebrew/homebrew-core/blob/master/Formula/sdl2_mixer.rb
==> Dependencies
Build: pkg-config ✘
Required: sdl2 ✔
Optional: flac ✘, fluid-synth ✘, smpeg2 ✘, libmikmod ✘, libmodplug ✘, libvorbis ✘
==> Options
--universal
    Build a universal binary
--with-flac
    Build with flac support
--with-fluid-synth
    Build with fluid-synth support
--with-libmikmod
    Build with libmikmod support
--with-libmodplug
    Build with libmodplug support
--with-libvorbis
    Build with libvorbis support
--with-smpeg2
    Build with smpeg2 support
--HEAD
    Install HEAD version

After doing some more research, it looks like the --with-flac, --with-fluid-synth, etc are probably needed?

johnthagen commented 7 years ago

I was able to get a .wav file to play using the following install:

$ brew install sdl2_mixer --with-flac --with-fluid-synth --with-libmikmod --with-libmodplug --with-libvorbis --with-smpeg2
brew list --versions
flac 1.3.1
fluid-synth 1.1.6
gettext 0.19.8.1
glib 2.50.1
libffi 3.0.13
libmikmod 3.3.8
libmodplug 0.8.8.5
libogg 1.3.2
libvorbis 1.3.5
pcre 8.39
pkg-config 0.29.1_2
sdl2 2.0.4
sdl2_mixer 2.0.1
smpeg2 2.0.0

Should this be the default way to install sdl2_mixer to work with rust-sdl2_mixer? If so, I'm happy to open a PR and update the README to help others.

andelf commented 7 years ago

👍 Yes, because default brew sdl2_mixer installation supports limited file formats. A PR for updating README is welcome.