git-svn-id: http://svn.freeswitch.org/svn/freeswitch/trunk@8954 d0543943-73ff-0310-b7d9-9358b9ac24b2
This commit is contained in:
Brian West 2008-07-09 13:50:58 +00:00
parent 53fda0eeca
commit fedca0da08
1 changed files with 13 additions and 1 deletions

View File

@ -32,6 +32,7 @@
#include <switch.h>
#include <pocketsphinx.h>
#include <sphinxbase/err.h>
SWITCH_MODULE_LOAD_FUNCTION(mod_pocketsphinx_load);
SWITCH_MODULE_SHUTDOWN_FUNCTION(mod_pocketsphinx_shutdown);
@ -113,6 +114,16 @@ static switch_status_t pocketsphinx_asr_load_grammar(switch_asr_handle_t *ah, co
model = switch_mprintf("%s%smodel%s%s", SWITCH_GLOBAL_dirs.grammar_dir, SWITCH_PATH_SEPARATOR, SWITCH_PATH_SEPARATOR, globals.model);
if (switch_file_exists(dic, ah->memory_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_ERROR, "Can't open dictionary.\n");
goto end;
}
if (switch_file_exists(lm, ah->memory_pool) != SWITCH_STATUS_SUCCESS) {
switch_log_printf(SWITCH_CHANNEL_LOG, SWITCH_LOG_WARNING, "Can't open language model.\n");
goto end;
}
switch_assert(lm && dic && model);
ps->config = cmd_ln_init(ps->config, ps_args(), FALSE,
@ -380,7 +391,8 @@ SWITCH_MODULE_LOAD_FUNCTION(mod_pocketsphinx_load)
asr_interface->asr_get_results = pocketsphinx_asr_get_results;
globals.model = switch_core_strdup(pool, "communicator");
err_set_logfp(NULL);
/* indicate that the module should continue to be loaded */
return SWITCH_STATUS_SUCCESS;
}