From 1a01075ec973db5b487714e39b8e8eb76afe99e8 Mon Sep 17 00:00:00 2001 From: Alex Janka Date: Sun, 15 Oct 2023 11:52:39 +1100 Subject: [PATCH] use default audio output config instead of trying to use maximum sample rate --- gb-emu/src/audio.rs | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/gb-emu/src/audio.rs b/gb-emu/src/audio.rs index 2a05763..0cef9c5 100644 --- a/gb-emu/src/audio.rs +++ b/gb-emu/src/audio.rs @@ -15,13 +15,9 @@ pub fn create_output(muted: bool) -> (AudioOutput, Stream) { .default_output_device() .expect("no output device available"); - let mut supported_configs_range = device - .supported_output_configs() - .expect("error while querying configs"); - let config = supported_configs_range - .next() - .expect("no supported config?!") - .with_max_sample_rate(); + let config = device + .default_output_config() + .expect("Couldn't get default config for audio output"); let sample_rate = config.sample_rate().0;