diff --git a/apps/openmw/mwsound/soundmanager.cpp b/apps/openmw/mwsound/soundmanager.cpp index eaa18e6dc..a09a4b056 100644 --- a/apps/openmw/mwsound/soundmanager.cpp +++ b/apps/openmw/mwsound/soundmanager.cpp @@ -7,6 +7,7 @@ #include #include +#include #include "../mwworld/environment.hpp" #include "../mwworld/world.hpp" @@ -64,7 +65,19 @@ namespace MWSound for(size_t i = 0;i < names.size();i++) std::cout <<" "<init(); + std::string devname = Settings::Manager::getString("device", "Sound"); + try + { + mOutput->init(devname); + } + catch(std::exception &e) + { + if(devname.empty()) + throw; + std::cout <<"Failed to open device \""<init(); + Settings::Manager::setString("device", "Sound", ""); + } } catch(std::exception &e) { diff --git a/files/settings-default.cfg b/files/settings-default.cfg index f616471cc..71637c326 100644 --- a/files/settings-default.cfg +++ b/files/settings-default.cfg @@ -53,3 +53,7 @@ fog end factor = 1.0 [Terrain] # Max. number of lights that affect the terrain. Setting to 1 will only reflect sunlight num lights = 8 + +[Sound] +# Device name. Blank means default +device =