Functions | |
| switch_status_t | switch_core_speech_open (_In_ switch_speech_handle_t *sh, const char *module_name, const char *voice_name, _In_ unsigned int rate, _In_ unsigned int interval, switch_speech_flag_t *flags, _In_ switch_memory_pool_t *pool) |
| Open a speech handle. | |
| switch_status_t | switch_core_speech_feed_tts (switch_speech_handle_t *sh, char *text, switch_speech_flag_t *flags) |
| Feed text to the TTS module. | |
| void | switch_core_speech_flush_tts (switch_speech_handle_t *sh) |
| Flush TTS audio on a given handle. | |
| void | switch_core_speech_text_param_tts (switch_speech_handle_t *sh, char *param, const char *val) |
| Set a text parameter on a TTS handle. | |
| void | switch_core_speech_numeric_param_tts (switch_speech_handle_t *sh, char *param, int val) |
| Set a numeric parameter on a TTS handle. | |
| void | switch_core_speech_float_param_tts (switch_speech_handle_t *sh, char *param, double val) |
| Set a float parameter on a TTS handle. | |
| 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) |
| Read rendered audio from the TTS module. | |
| switch_status_t | switch_core_speech_close (switch_speech_handle_t *sh, switch_speech_flag_t *flags) |
| Close an open speech handle. | |
| switch_status_t | switch_core_asr_open (switch_asr_handle_t *ah, const char *module_name, const char *codec, int rate, const char *dest, switch_asr_flag_t *flags, switch_memory_pool_t *pool) |
| Open an asr handle. | |
| switch_status_t | switch_core_asr_close (switch_asr_handle_t *ah, switch_asr_flag_t *flags) |
| Close an asr handle. | |
| switch_status_t | switch_core_asr_feed (switch_asr_handle_t *ah, void *data, unsigned int len, switch_asr_flag_t *flags) |
| Feed audio data to an asr handle. | |
| switch_status_t | switch_core_asr_check_results (switch_asr_handle_t *ah, switch_asr_flag_t *flags) |
| Check an asr handle for results. | |
| switch_status_t | switch_core_asr_get_results (switch_asr_handle_t *ah, char **xmlstr, switch_asr_flag_t *flags) |
| Get results from an asr handle. | |
| switch_status_t | switch_core_asr_load_grammar (switch_asr_handle_t *ah, const char *grammar, const char *path) |
| Load a grammar to an asr handle. | |
| switch_status_t | switch_core_asr_unload_grammar (switch_asr_handle_t *ah, const char *grammar) |
| Unload a grammar from an asr handle. | |
| switch_status_t | switch_core_asr_pause (switch_asr_handle_t *ah) |
| Pause detection on an asr handle. | |
| switch_status_t | switch_core_asr_resume (switch_asr_handle_t *ah) |
| Resume detection on an asr handle. | |
|
||||||||||||
|
Check an asr handle for results.
00146 {
00147 switch_assert(ah != NULL);
00148
00149 return ah->asr_interface->asr_check_results(ah, flags);
00150 }
|
|
||||||||||||
|
Close an asr handle.
00124 {
00125 switch_status_t status;
00126
00127 switch_assert(ah != NULL);
00128
00129 status = ah->asr_interface->asr_close(ah, flags);
00130
00131 if (switch_test_flag(ah, SWITCH_ASR_FLAG_FREE_POOL)) {
00132 switch_core_destroy_memory_pool(&ah->memory_pool);
00133 }
00134
00135 return status;
00136 }
|
|
||||||||||||||||||||
|
Feed audio data to an asr handle.
00139 {
00140 switch_assert(ah != NULL);
00141
00142 return ah->asr_interface->asr_feed(ah, data, len, flags);
00143 }
|
|
||||||||||||||||
|
Get results from an asr handle.
00153 {
00154 switch_assert(ah != NULL);
00155
00156 return ah->asr_interface->asr_get_results(ah, xmlstr, flags);
00157 }
|
|
||||||||||||||||
|
Load a grammar to an asr handle.
00082 {
00083 char *epath = NULL;
00084 switch_status_t status;
00085
00086 switch_assert(ah != NULL);
00087
00088 if (!switch_is_file_path(path)) {
00089 epath = switch_mprintf("%s%s%s", SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_PATH_SEPARATOR, path);
00090 path = epath;
00091 }
00092
00093 status = ah->asr_interface->asr_load_grammar(ah, grammar, path);
00094 switch_safe_free(epath);
00095
00096 return status;
00097 }
|
Here is the call graph for this function:

|
||||||||||||||||||||||||||||||||
|
Open an asr handle.
00041 {
00042 switch_status_t status;
00043 char buf[256] = "";
00044 char *param = NULL;
00045
00046 if (strchr(module_name, '@')) {
00047 switch_set_string(buf, module_name);
00048 if ((param = strchr(buf, '@'))) {
00049 *param++ = '\0';
00050 module_name = buf;
00051 }
00052 }
00053
00054 switch_assert(ah != NULL);
00055
00056 if ((ah->asr_interface = switch_loadable_module_get_asr_interface(module_name)) == 0) {
00057 switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "invalid asr module [%s]!\n", module_name);
00058 return SWITCH_STATUS_GENERR;
00059 }
00060
00061 ah->flags = *flags;
00062
00063 if (pool) {
00064 ah->memory_pool = pool;
00065 } else {
00066 if ((status = switch_core_new_memory_pool(&ah->memory_pool)) != SWITCH_STATUS_SUCCESS) {
00067 return status;
00068 }
00069 switch_set_flag(ah, SWITCH_ASR_FLAG_FREE_POOL);
00070 }
00071
00072 if (param) {
00073 ah->param = switch_core_strdup(ah->memory_pool, param);
00074 }
00075 ah->rate = rate;
00076 ah->name = switch_core_strdup(ah->memory_pool, module_name);
00077
00078 return ah->asr_interface->asr_open(ah, codec, rate, dest, flags);
00079 }
|
Here is the call graph for this function:

|
|
Pause detection on an asr handle.
00110 {
00111 switch_assert(ah != NULL);
00112
00113 return ah->asr_interface->asr_pause(ah);
00114 }
|
|
|
Resume detection on an asr handle.
00117 {
00118 switch_assert(ah != NULL);
00119
00120 return ah->asr_interface->asr_resume(ah);
00121 }
|
|
||||||||||||
|
Unload a grammar from an asr handle.
00100 {
00101 switch_status_t status;
00102
00103 switch_assert(ah != NULL);
00104 status = ah->asr_interface->asr_unload_grammar(ah, grammar);
00105
00106 return status;
00107 }
|
|
||||||||||||
|
Close an open speech handle.
00139 {
00140 switch_status_t status = sh->speech_interface->speech_close(sh, flags);
00141
00142 if (switch_test_flag(sh, SWITCH_SPEECH_FLAG_FREE_POOL)) {
00143 switch_core_destroy_memory_pool(&sh->memory_pool);
00144 }
00145
00146 return status;
00147 }
|
|
||||||||||||||||
|
Feed text to the TTS module.
00087 {
00088 switch_assert(sh != NULL);
00089
00090 return sh->speech_interface->speech_feed_tts(sh, text, flags);
00091 }
|
|
||||||||||||||||
|
Set a float parameter on a TTS handle.
00121 {
00122 switch_assert(sh != NULL);
00123
00124 if (sh->speech_interface->speech_float_param_tts) {
00125 sh->speech_interface->speech_float_param_tts(sh, param, val);
00126 }
00127 }
|
|
|
Flush TTS audio on a given handle.
00094 {
00095 switch_assert(sh != NULL);
00096
00097 if (sh->speech_interface->speech_flush_tts) {
00098 sh->speech_interface->speech_flush_tts(sh);
00099 }
00100 }
|
|
||||||||||||||||
|
Set a numeric parameter on a TTS handle.
00112 {
00113 switch_assert(sh != NULL);
00114
00115 if (sh->speech_interface->speech_numeric_param_tts) {
00116 sh->speech_interface->speech_numeric_param_tts(sh, param, val);
00117 }
00118 }
|
|
||||||||||||||||||||||||||||||||
|
Open a speech handle.
|
|
||||||||||||||||||||||||
|
Read rendered audio from the TTS module.
00131 {
00132 switch_assert(sh != NULL);
00133
00134 return sh->speech_interface->speech_read_tts(sh, data, datalen, rate, flags);
00135 }
|
|
||||||||||||||||
|
Set a text parameter on a TTS handle.
00103 {
00104 switch_assert(sh != NULL);
00105
00106 if (sh->speech_interface->speech_text_param_tts) {
00107 sh->speech_interface->speech_text_param_tts(sh, param, val);
00108 }
00109 }
|
1.3.9.1