#include <stdio.h>
#include <string.h>
#include <assert.h>
-#include <math.h>
+#include <cmath>
#include <string>
#include <sstream>
void
FGVoicePlayer::init ()
{
- SGSoundMgr *smgr = globals->get_soundmgr();
+ SGSoundMgr *smgr = globals->get_subsystem<SGSoundMgr>();
_sgr = smgr->find("avionics", true);
_sgr->tie_to_listener();
speaker.update_configuration();
if (! sample)
{
string filename = dir_prefix + string(name) + ".wav";
- try
- {
- sample = new SGSoundSample(filename.c_str(), SGPath());
- }
- catch (const sg_exception &e)
- {
- SG_LOG(SG_SOUND, SG_ALERT, "Error loading sound sample \"" + filename + "\": " + e.getFormattedMessage());
- exit(1);
- }
-
+ sample = new SGSoundSample(filename.c_str(), SGPath());
+
_sgr->add(sample, refname);
samples[refname] = sample;
}