#endif
/* Speech structure flags */
-#define AST_SPEECH_QUIET (1 << 0) /* Quiet down output... they are talking */
-#define AST_SPEECH_SPOKE (1 << 1) /* Speaker did not speak */
+#define AST_SPEECH_QUIET (1 << 0) /* Quiet down output... they are talking */
+#define AST_SPEECH_SPOKE (1 << 1) /* Speaker did not speak */
+#define AST_SPEECH_HAVE_RESULTS (1 << 2) /* Results are present */
/* Speech structure states - in order of expected change */
#define AST_SPEECH_STATE_NOT_READY 0 /* Not ready to accept audio */
{
struct ast_speech_result *result = NULL;
- if (speech->engine->get != NULL) {
+ if (speech->engine->get != NULL && ast_test_flag(speech, AST_SPEECH_HAVE_RESULTS)) {
result = speech->engine->get(speech);
}
/* Clear any flags that may affect things */
ast_clear_flag(speech, AST_SPEECH_SPOKE);
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 (speech->results != NULL) {