Merge branch 'james/audio-fix' into 'master'

Fix audio disabling

See merge request veloren/veloren!1534
This commit is contained in:
Marcel 2020-11-20 00:39:39 +00:00
commit d369e8a7c9

View File

@ -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);