add resampler to speech handles

git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@12141 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Anthony Minessale
2009-02-18 18:53:28 +00:00
parent 1b5656f3a8
commit da507c5f1e
7 changed files with 107 additions and 14 deletions
+1 -1
View File
@@ -1432,7 +1432,7 @@ SWITCH_DECLARE(void) switch_core_speech_float_param_tts(switch_speech_handle_t *
\return SWITCH_STATUS_SUCCESS with len adjusted to the bytes written if successful
*/
SWITCH_DECLARE(switch_status_t) switch_core_speech_read_tts(switch_speech_handle_t *sh,
void *data, switch_size_t *datalen, uint32_t *rate, switch_speech_flag_t *flags);
void *data, switch_size_t *datalen, switch_speech_flag_t *flags);
/*!
\brief Close an open speech handle
\param sh the speech handle to close
+11 -1
View File
@@ -389,7 +389,7 @@ struct switch_speech_interface {
/*! function to feed audio to the ASR */
switch_status_t (*speech_feed_tts) (switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags);
/*! function to read audio from the TTS */
switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, uint32_t *rate, switch_speech_flag_t *flags);
switch_status_t (*speech_read_tts) (switch_speech_handle_t *sh, void *data, switch_size_t *datalen, switch_speech_flag_t *flags);
void (*speech_flush_tts) (switch_speech_handle_t *sh);
void (*speech_text_param_tts) (switch_speech_handle_t *sh, char *param, const char *val);
void (*speech_numeric_param_tts) (switch_speech_handle_t *sh, char *param, int val);
@@ -420,6 +420,16 @@ struct switch_speech_handle {
char *param;
/*! the handle's memory pool */
switch_memory_pool_t *memory_pool;
switch_audio_resampler_t *resampler;
switch_buffer_t *buffer;
switch_byte_t *dbuf;
switch_size_t dbuflen;
/*! the current samplerate */
uint32_t samplerate;
/*! the current native samplerate */
uint32_t native_rate;
/*! the number of channels */
/*! private data for the format module to store handle specific info */
void *private_info;
};
+3 -1
View File
@@ -944,7 +944,9 @@ typedef enum {
SWITCH_SPEECH_FLAG_PEEK = (1 << 1),
SWITCH_SPEECH_FLAG_FREE_POOL = (1 << 2),
SWITCH_SPEECH_FLAG_BLOCKING = (1 << 3),
SWITCH_SPEECH_FLAG_PAUSE = (1 << 4)
SWITCH_SPEECH_FLAG_PAUSE = (1 << 4),
SWITCH_SPEECH_FLAG_OPEN = (1 << 5),
SWITCH_SPEECH_FLAG_DONE = (1 << 6)
} switch_speech_flag_enum_t;
typedef uint32_t switch_speech_flag_t;