}
}
+ switch_channel_audio_sync(channel);
+
ilen = len;
for (;;) {
switch_event_t *event;
}
}
}
-
}
done:
if (cache_obj->timer.interval) {
switch_core_timer_destroy(&cache_obj->timer);
}
- switch_core_speech_close(&cache_obj->sh, &flags);
- switch_core_codec_destroy(&cache_obj->codec);
+ if (&cache_obj->sh && cache_obj->sh.speech_interface) {
+ switch_core_speech_close(&cache_obj->sh, &flags);
+ }
+ if (&cache_obj->codec) {
+ switch_core_codec_destroy(&cache_obj->codec);
+ }
switch_channel_set_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME, NULL);
}
}
timer = <imer;
if ((var = switch_channel_get_variable(channel, SWITCH_CACHE_SPEECH_HANDLES_VARIABLE)) && switch_true(var)) {
- if ((cache_obj = switch_channel_get_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME))) {
+ if ((cache_obj = (cached_speech_handle_t *) switch_channel_get_private(channel, SWITCH_CACHE_SPEECH_HANDLES_OBJ_NAME))) {
need_create = 0;
if (!strcasecmp(cache_obj->tts_name, tts_name)) {
need_alloc = 0;
}
if (!cache_obj) {
- cache_obj = switch_core_session_alloc(session, sizeof(*cache_obj));
+ cache_obj = (cached_speech_handle_t *) switch_core_session_alloc(session, sizeof(*cache_obj));
}
if (need_alloc) {
switch_copy_string(cache_obj->tts_name, tts_name, sizeof(cache_obj->tts_name));