SGPropertyNode_ptr voice = voices[i];
if( voice->getBoolValue("festival", false ) ) {
try {
- SG_LOG(SG_ALL,SG_ALERT,"creating festival voice" );
_voices.push_back(new FGFestivalVoice(this, voice));
- } catch (const std::string& s) {
- SG_LOG(SG_SOUND, SG_ALERT, "VOICE: " << s);
+ continue;
+ } catch (const std::string& ) {
+ SG_LOG(SG_SOUND, SG_WARN, "failed to create festival voice, falling back to flite voice" );
}
- } else {
+ }
#if defined(ENABLE_FLITE)
- SG_LOG(SG_ALL,SG_ALERT,"creating flite voice" );
- _voices.push_back(new FGFLITEVoice(this, voice));
+ SG_LOG(SG_SOUND,SG_INFO,"creating flite voice" );
+ _voices.push_back(new FGFLITEVoice(this, voice));
#else
- SG_LOG(SG_ALL,SG_ALERT,"non festival voice not supported." );
+ SG_LOG(SG_SOUND,SG_ALERT,"non festival voice not supported." );
#endif
- }
}
#if defined(ENABLE_THREADS)
void FGVoiceMgr::shutdown()
{
#if defined(ENABLE_THREADS)
- _thread->cancel();
- _thread->join();
- delete _thread;
- _thread = NULL;
+ if( _thread ) {
+ _thread->cancel();
+ _thread->join();
+ delete _thread;
+ _thread = NULL;
+ }
#endif
for( std::vector<FGVoice*>::iterator it = _voices.begin(); it != _voices.end(); ++it )