some bullshit
This commit is contained in:
20
src/main.rs
20
src/main.rs
@@ -1,3 +1,19 @@
|
||||
fn main() {
|
||||
println!("Hello, world!");
|
||||
use std::io::Cursor;
|
||||
|
||||
use rodio::{Decoder, OutputStream, Sink};
|
||||
|
||||
const SONG: &[u8] = include_bytes!("song.ogg");
|
||||
|
||||
fn main() -> anyhow::Result<()> {
|
||||
let (_stream, stream_handle) = OutputStream::try_default()?;
|
||||
let sink = Sink::try_new(&stream_handle)?;
|
||||
let cursor = Cursor::new(SONG);
|
||||
|
||||
let source = Decoder::new(cursor)?;
|
||||
|
||||
sink.append(source);
|
||||
|
||||
sink.sleep_until_end();
|
||||
|
||||
Ok(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user