From 3ef00c4e769347864105e7d1fcd4eeb444937ec0 Mon Sep 17 00:00:00 2001 From: jiminycrick Date: Thu, 19 Nov 2020 10:46:31 -0800 Subject: [PATCH] Fix audio disabling --- voxygen/src/main.rs | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index e4c5b60a42..58e8d63078 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -9,7 +9,7 @@ use veloren_voxygen::{ logging, profile::Profile, run, - settings::Settings, + settings::{AudioOutput, Settings}, window::Window, GlobalState, }; @@ -142,14 +142,11 @@ fn main() { anim::init(); // Setup audio - //let mut audio = match settings.audio.output { - // AudioOutput::Off => None, - // AudioOutput::Automatic => audio::get_default_device(), - // AudioOutput::Device(ref dev) => Some(dev.clone()), - //} - //.map(|dev| AudioFrontend::new(dev, settings.audio.max_sfx_channels)) - //.unwrap_or_else(AudioFrontend::no_audio); - let mut audio = AudioFrontend::new(settings.audio.max_sfx_channels); + let mut audio = match settings.audio.output { + AudioOutput::Off => AudioFrontend::no_audio(), + AudioOutput::Automatic => AudioFrontend::new(settings.audio.max_sfx_channels), + // AudioOutput::Device(ref dev) => Some(dev.clone()), + }; audio.set_music_volume(settings.audio.music_volume); audio.set_sfx_volume(settings.audio.sfx_volume);