]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
pad beginning of tts buffer with silence in mod_cepstral
authorAnthony Minessale <anthony.minessale@gmail.com>
Thu, 21 Sep 2006 01:38:37 +0000 (01:38 +0000)
committerAnthony Minessale <anthony.minessale@gmail.com>
Thu, 21 Sep 2006 01:38:37 +0000 (01:38 +0000)
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2771 d0543943-73ff-0310-b7d9-9358b9ac24b2

src/mod/asr_tts/mod_cepstral/mod_cepstral.c

index fd332baa5f6d8fd948f9411c53b48b4858952a51..42b06bd9e8825618a0996fc0bcfbf6f76e960539 100644 (file)
@@ -215,6 +215,14 @@ static switch_status_t cepstral_speech_feed_tts(switch_speech_handle_t *sh, char
        cepstral->done = 0;
        
        cepstral->tts_stream = NULL;
+
+       if (cepstral->audio_buffer) {
+               switch_byte_t data[1280];
+               memset(data, 255, sizeof(data));
+               switch_mutex_lock(cepstral->audio_lock);
+               switch_buffer_write(cepstral->audio_buffer, data, sizeof(data));
+               switch_mutex_unlock(cepstral->audio_lock);
+       }
        
        if (!strncasecmp(text, fp, len)) {
                text += len;