]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
don't seg if we forget voice
authorRaymond Chandler <intralanman@gmail.com>
Tue, 15 Jan 2013 20:57:02 +0000 (15:57 -0500)
committerRaymond Chandler <intralanman@gmail.com>
Tue, 15 Jan 2013 20:57:02 +0000 (15:57 -0500)
src/mod/asr_tts/mod_flite/mod_flite.c

index be7abd1915b11b8d123dcf5849134ba5bc956f26..baa81840f78b9e7474263b142cacf00105c543d2 100644 (file)
@@ -24,6 +24,7 @@
  * Contributor(s):
  * 
  * Brian West <brian@freeswitch.org>
+ * Raymond Chandler <intralanman@freeswitch.org>
  *
  * 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")) {