rodio/examples/music_m4a.rs
Austin Schey 0988e8c886
Add optional Symphonia backend (#376)
* add symphonia decoder

* add symphonia-flac

* better compile errors

* remove unsafe send

* update ci

* sudo

* disable duration check because symphonia does not support it

* add error handling

* cleanup

* update symphonia and fix breaking changes

* update to published symphonia version

* update docs

* reduce namespace duplication

* remove extra reference to current frame

* pr comments

* exclude decoders from module if unused

* fix flac test

* recommend disabling default features with symphonia
2021-06-29 09:12:28 +02:00

11 lines
333 B
Rust

use std::io::BufReader;
fn main() {
let (_stream, handle) = rodio::OutputStream::try_default().unwrap();
let sink = rodio::Sink::try_new(&handle).unwrap();
let file = std::fs::File::open("examples/music.m4a").unwrap();
sink.append(rodio::Decoder::new(BufReader::new(file)).unwrap());
sink.sleep_until_end();
}