diff --git a/voxygen/src/main.rs b/voxygen/src/main.rs index 8e091ad6ba..431a80c70f 100644 --- a/voxygen/src/main.rs +++ b/voxygen/src/main.rs @@ -84,8 +84,14 @@ pub trait PlayState { fn main() { // Set up the global state. let settings = Settings::load(); + let audio = if settings.audio.audio_on { + AudioFrontend::new() + } else { + AudioFrontend::no_audio() + }; + let mut global_state = GlobalState { - audio: AudioFrontend::new(), // TODO: Provide `AudioFrontend::no_audio()` feature during initialisation, the config will be stored in `ron` object list. + audio, window: Window::new(&settings).expect("Failed to create window!"), settings, }; diff --git a/voxygen/src/settings.rs b/voxygen/src/settings.rs index 01ab21fa8c..17f08105cd 100644 --- a/voxygen/src/settings.rs +++ b/voxygen/src/settings.rs @@ -144,6 +144,7 @@ pub struct AudioSettings { /// Audio Device that Voxygen will use to play audio. pub audio_device: Option, + pub audio_on: bool, } impl Default for AudioSettings { @@ -153,6 +154,7 @@ impl Default for AudioSettings { music_volume: 0.5, sfx_volume: 0.5, audio_device: None, + audio_on: true, } } }