some bullshit

This commit is contained in:
Rph :3
2024-03-30 19:04:58 +01:00
parent 5fdbb8a208
commit 1aa12fa2dc
5 changed files with 847 additions and 98 deletions

View File

@@ -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(())
}