rodio icon indicating copy to clipboard operation
rodio copied to clipboard

no sound output on osx

Open z3t0 opened this issue 8 years ago • 5 comments

z3t0 avatar Apr 12 '17 06:04 z3t0

Ran into this today also on macos.

extern crate rodio;

use std::fs::File;
use std::io::BufReader;

use rodio::Source;

fn main() {

    let endpoint = rodio::get_default_endpoint().unwrap();
    let sink = rodio::Sink::new(&endpoint);

    let file = File::open("sound.wav").unwrap();
    let source = rodio::Decoder::new(BufReader::new(file)).unwrap();

    sink.append(source);

    sink.play();

    sink.sleep_until_end();

}

Produces no audio output, & sleeps forever (Audio file is 1s long.)

Anything else I can provide to help debug?

BorisKourt avatar Apr 15 '17 19:04 BorisKourt

Try following https://github.com/tomaka/cpal/issues/148

z3t0 avatar Apr 15 '17 20:04 z3t0

Also experiencing this. This is unrelated to tomaka/cpal#148 as far as I can tell. Even after testing with this fix, there is no sound.

mlindner avatar Apr 16 '17 07:04 mlindner

If rodio doesn't output any sound, then it's a bug in cpal. Rodio uses cpal in the way it's intended to be used.

tomaka avatar Apr 16 '17 08:04 tomaka

This seems to be caused by a change in tomaka/cpal#136 if I revert the changes, rodio outputs sound

shockham avatar Apr 19 '17 09:04 shockham