add dynamic buffers

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@2583 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale committed 2006-09-08 18:57:24 +00:00
1 parent 4960fbc73f
commit f689b62fb6
9 files changed
+143 -14

No files matched your search

+5 -2
View File
@@ -42,7 +42,8 @@
#include <swift.h>
#include <switch.h>
#define MY_BUF_LEN 1024 * 256
#define MY_BUF_LEN 1024 * 32
#define MY_BLOCK_SIZE MY_BUF_LEN
static const char modname[] = "mod_cepstral";
@@ -119,7 +120,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, MY_BUF_LEN) != SWITCH_STATUS_SUCCESS) {
if (switch_buffer_create_dynamic(&cepstral->audio_buffer, MY_BLOCK_SIZE, MY_BUF_LEN, 0) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_CRIT, "Write Buffer Failed!\n");
return SWITCH_STATUS_MEMERR;
}
@@ -195,6 +196,8 @@ static switch_status_t cepstral_speech_close(switch_speech_handle_t *sh, switch_
cepstral->port = NULL;
//cepstral->engine = NULL;
switch_buffer_destroy(&cepstral->audio_buffer);
return SWITCH_STATUS_SUCCESS;
}