buffer was too small on cepstral damn it
git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@1516 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
parent
baa257f2fe
commit
ac8a3e43ea
|
@ -67,6 +67,7 @@ static swift_result_t write_audio(swift_event *event, swift_event_t type, void *
|
|||
/* 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;
|
||||
}
|
||||
|
@ -91,7 +92,7 @@ static switch_status_t cepstral_speech_open(switch_speech_handle_t *sh, char *vo
|
|||
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;
|
||||
}
|
||||
|
@ -168,7 +169,6 @@ static switch_status_t cepstral_speech_feed_tts(switch_speech_handle_t *sh, char
|
|||
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);
|
||||
|
||||
|
@ -201,8 +201,6 @@ static switch_status_t cepstral_speech_read_tts(switch_speech_handle_t *sh,
|
|||
|
||||
used = switch_buffer_inuse(cepstral->audio_buffer);
|
||||
|
||||
|
||||
|
||||
if (!used && cepstral->done_gen) {
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -1449,7 +1449,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_session_perform_kill_channel(switch_
|
|||
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) {
|
||||
|
@ -1717,7 +1717,7 @@ SWITCH_DECLARE(switch_status_t) switch_core_new_memory_pool(switch_memory_pool_t
|
|||
|
||||
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;
|
||||
}
|
||||
|
|
|
@ -696,7 +696,6 @@ static int rtp_common_read(switch_rtp_t *rtp_session, switch_payload_t *payload_
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue