From c8c0984136be0e809fc5a249ac9bf67c441ccb8a Mon Sep 17 00:00:00 2001 From: Raymond Chandler Date: Tue, 15 Jan 2013 15:57:02 -0500 Subject: [PATCH] don't seg if we forget voice --- src/mod/asr_tts/mod_flite/mod_flite.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/mod/asr_tts/mod_flite/mod_flite.c b/src/mod/asr_tts/mod_flite/mod_flite.c index be7abd1915..baa81840f7 100644 --- a/src/mod/asr_tts/mod_flite/mod_flite.c +++ b/src/mod/asr_tts/mod_flite/mod_flite.c @@ -24,6 +24,7 @@ * Contributor(s): * * Brian West + * Raymond Chandler * * mod_flite.c -- Flite Interface * @@ -77,6 +78,11 @@ static switch_status_t flite_speech_open(switch_speech_handle_t *sh, const char sh->native_rate = 16000; + if (!voice_name) { + switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "A voice is required. Valid voice names are awb, rms, slt or kal.\n"); + return SWITCH_STATUS_FALSE; + } + if (!strcasecmp(voice_name, "awb")) { flite->v = globals.awb; } else if (!strcasecmp(voice_name, "kal")) {