From 8c1713aff5eedd229aaf1319adb5d96801ae27c2 Mon Sep 17 00:00:00 2001 From: Evan Martin Date: Sat, 5 Oct 2024 10:41:50 -0700 Subject: [PATCH] audio: pocoman opening works --- cli/src/host.rs | 2 +- cli/src/sdl.rs | 78 +++++++++++++++++++++++++++++++++- web/glue/src/host.rs | 2 +- win32/src/host.rs | 2 +- win32/src/winapi/winmm/wave.rs | 11 ++++- 5 files changed, 88 insertions(+), 7 deletions(-) diff --git a/cli/src/host.rs b/cli/src/host.rs index 568683db..296106fa 100644 --- a/cli/src/host.rs +++ b/cli/src/host.rs @@ -220,7 +220,7 @@ impl win32::Host for EnvRef { gui.create_surface(opts) } - fn write_audio(&mut self, buf: &[i16]) { + fn write_audio(&mut self, buf: &[u8]) { let mut env = self.0.borrow_mut(); let gui = env.ensure_gui().unwrap(); gui.write_audio(buf); diff --git a/cli/src/sdl.rs b/cli/src/sdl.rs index f198dee7..dcbeeba4 100644 --- a/cli/src/sdl.rs +++ b/cli/src/sdl.rs @@ -78,11 +78,13 @@ fn message_from_events( } pub struct GUI { + sdl: sdl2::Sdl, video: sdl2::VideoSubsystem, pump: sdl2::EventPump, timer: sdl2::TimerSubsystem, win: Option, msg_queue: Option, + audio: Option