/* Only proceed when we have success */
if (!SWIFT_FAILED((rv = swift_event_get_audio(event, &buf, &len)))) {
switch_mutex_lock(cepstral->audio_lock);
+
if (switch_buffer_write(cepstral->audio_buffer, buf, len) <= 0) {
rv = SWIFT_UNKNOWN_ERROR;
}
return SWITCH_STATUS_MEMERR;
}
- if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, SWITCH_RECCOMMENDED_BUFFER_SIZE) != SWITCH_STATUS_SUCCESS) {
+ if (switch_buffer_create(sh->memory_pool, &cepstral->audio_buffer, 1024 * 256) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write Buffer Failed!\n");
return SWITCH_STATUS_MEMERR;
}
cepstral = sh->private_info;
assert(cepstral != NULL);
-
swift_port_speak_text(cepstral->port, text, 0, NULL, &cepstral->tts_stream, NULL);
//swift_port_speak_text(cepstral->port, text, 0, NULL, NULL, NULL);
used = switch_buffer_inuse(cepstral->audio_buffer);
-
-
if (!used && cepstral->done_gen) {
break;
}
switch_io_event_hook_kill_channel_t *ptr;
switch_status_t status = SWITCH_STATUS_FALSE;
- switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_NOTICE, "Kill %s [%d]\n", switch_channel_get_name(session->channel), sig);
+ switch_log_printf(SWITCH_CHANNEL_ID_LOG, (char *) file, func, line, SWITCH_LOG_INFO, "Kill %s [%d]\n", switch_channel_get_name(session->channel), sig);
if (session->endpoint_interface->io_routines->kill_channel) {
if ((status = session->endpoint_interface->io_routines->kill_channel(session, sig)) == SWITCH_STATUS_SUCCESS) {
assert(runtime.memory_pool != NULL);
- if ((apr_pool_create(pool, runtime.memory_pool)) != SWITCH_STATUS_SUCCESS) {
+ if ((apr_pool_create(pool, NULL)) != SWITCH_STATUS_SUCCESS) {
*pool = NULL;
return SWITCH_STATUS_MEMERR;
}
for(;;) {
bytes = sizeof(rtp_msg_t);
status = switch_socket_recvfrom(rtp_session->from_addr, rtp_session->sock, 0, (void *)&rtp_session->recv_msg, &bytes);
-
if (switch_test_flag(rtp_session, SWITCH_RTP_FLAG_BREAK)) {
switch_clear_flag(rtp_session, SWITCH_RTP_FLAG_BREAK);