diff --git a/src/main.rs b/src/main.rs index 360a589..4a32bc0 100644 --- a/src/main.rs +++ b/src/main.rs @@ -64,10 +64,11 @@ fn main() -> Result<()> { }; // Initialize Audio + let (_stream, stream_handle) = OutputStream::try_default().expect("Initialized Audio"); + if AUDIO_ENABLED { let spsc: AudioSPSC = Default::default(); let (prod, cons) = spsc.init(); - let (_stream, stream_handle) = OutputStream::try_default().expect("Initialized Audio"); let sink = Sink::try_new(&stream_handle)?; sink.append(cons); game_boy.apu_mut().attach_producer(prod);