|
|
|
@ -92,7 +92,7 @@ int ast_speech_grammar_unload(struct ast_speech *speech, char *grammar_name)
|
|
|
|
/*! \brief Return the results of a recognition from the speech structure */
|
|
|
|
/*! \brief Return the results of a recognition from the speech structure */
|
|
|
|
struct ast_speech_result *ast_speech_results_get(struct ast_speech *speech)
|
|
|
|
struct ast_speech_result *ast_speech_results_get(struct ast_speech *speech)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
return (speech->engine->get ? speech->engine->get(speech) : NULL);
|
|
|
|
return ((speech->engine->get && ast_test_flag(speech, AST_SPEECH_HAVE_RESULTS)) ? speech->engine->get(speech) : NULL);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
/*! \brief Free a list of results */
|
|
|
|
/*! \brief Free a list of results */
|
|
|
|
@ -128,6 +128,7 @@ void ast_speech_start(struct ast_speech *speech)
|
|
|
|
/* Clear any flags that may affect things */
|
|
|
|
/* Clear any flags that may affect things */
|
|
|
|
ast_clear_flag(speech, AST_SPEECH_SPOKE);
|
|
|
|
ast_clear_flag(speech, AST_SPEECH_SPOKE);
|
|
|
|
ast_clear_flag(speech, AST_SPEECH_QUIET);
|
|
|
|
ast_clear_flag(speech, AST_SPEECH_QUIET);
|
|
|
|
|
|
|
|
ast_clear_flag(speech, AST_SPEECH_HAVE_RESULTS);
|
|
|
|
|
|
|
|
|
|
|
|
/* If results are on the structure, free them since we are starting again */
|
|
|
|
/* If results are on the structure, free them since we are starting again */
|
|
|
|
if (speech->results) {
|
|
|
|
if (speech->results) {
|
|
|
|
|