- static SGPropertyNode *sound_enabled = fgGetNode("/sim/sound/enabled");
- static SGSoundMgr *smgr = globals->get_soundmgr();
- static bool smgr_enabled = true;
- if (smgr_enabled != sound_enabled->getBoolValue()) {
- if (smgr_enabled == true) { // request to suspend
- smgr->suspend();
- } else {
- smgr->resume();
+ static bool smgr_init = true;
+ if (smgr_init == true) {
+ static SGPropertyNode *sound_working = fgGetNode("/sim/sound/working");
+ if (sound_working->getBoolValue() == true) {
+ fgInitSoundManager();
+ smgr_init = false;
+ }
+ } else {
+ static SGPropertyNode *sound_enabled = fgGetNode("/sim/sound/enabled");
+ static SGSoundMgr *smgr = globals->get_soundmgr();
+ static bool smgr_enabled = true;
+
+ if (smgr_enabled != sound_enabled->getBoolValue()) {
+ if (smgr_enabled == true) { // request to suspend
+ smgr->suspend();
+ smgr_enabled = false;
+ } else {
+ smgr->resume();
+ smgr_enabled = true;
+ }