use default audio output config instead of trying to use maximum sample rate

This commit is contained in:
Alex Janka 2023-10-15 11:52:39 +11:00
parent 9681706516
commit 1a01075ec9

View file

@ -15,13 +15,9 @@ pub fn create_output(muted: bool) -> (AudioOutput, Stream) {
.default_output_device() .default_output_device()
.expect("no output device available"); .expect("no output device available");
let mut supported_configs_range = device let config = device
.supported_output_configs() .default_output_config()
.expect("error while querying configs"); .expect("Couldn't get default config for audio output");
let config = supported_configs_range
.next()
.expect("no supported config?!")
.with_max_sample_rate();
let sample_rate = config.sample_rate().0; let sample_rate = config.sample_rate().0;