diff --git a/simgear/sound/xmlsound.cxx b/simgear/sound/xmlsound.cxx index 89331390..b358b2a6 100644 --- a/simgear/sound/xmlsound.cxx +++ b/simgear/sound/xmlsound.cxx @@ -84,7 +84,7 @@ SGXmlSound::~SGXmlSound() _pitch.clear(); } -void +bool SGXmlSound::init( SGPropertyNode *root, SGPropertyNode *node, SGSampleGroup *sgrp, @@ -315,8 +315,8 @@ SGXmlSound::init( SGPropertyNode *root, string soundFileStr = node->getStringValue("path", ""); _sample = new SGSoundSample(soundFileStr.c_str(), path); if (!_sample->file_path().exists()) { - throw sg_io_exception("XML sound: couldn't find file: '" + soundFileStr + "'"); - return; + SG_LOG(SG_SOUND, SG_WARN, "XML sound: couldn't find file: '" + soundFileStr + "'"); + return false; } _sample->set_relative_position( offset_pos ); @@ -328,6 +328,8 @@ SGXmlSound::init( SGPropertyNode *root, _sample->set_volume( v ); _sample->set_pitch( p ); _sgrp->add( _sample, _name ); + + return true; } void diff --git a/simgear/sound/xmlsound.hxx b/simgear/sound/xmlsound.hxx index 8b24acc6..11bbfcc4 100644 --- a/simgear/sound/xmlsound.hxx +++ b/simgear/sound/xmlsound.hxx @@ -107,7 +107,7 @@ public: * @param avionics A pointer to the pre-initialized avionics sample group. * @param path The path where the audio files remain. */ - virtual void init( SGPropertyNode *root, + virtual bool init( SGPropertyNode *root, SGPropertyNode *child, SGSampleGroup *sgrp, SGSampleGroup *avionics,