aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-06 01:15:50 +0000
committerfile <file@f38db490-d61c-443f-a65b-d21fe96a405b>2007-04-06 01:15:50 +0000
commit5f1367dd74a624f13c6961d727c1f19ee61b536b (patch)
treeaeab6cb7a6097b1ac4817f9d87a43211cd86e096 /include
parentd30e10b717c97c48f41c6ef4dfed5b6ec08cd0af (diff)
Merged revisions 60361 via svnmerge from
https://origsvn.digium.com/svn/asterisk/branches/1.4 ........ r60361 | file | 2007-04-05 22:14:00 -0300 (Thu, 05 Apr 2007) | 2 lines Add support for returning different types of results (ie: NBest). ........ git-svn-id: http://svn.digium.com/svn/asterisk/trunk@60362 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'include')
-rw-r--r--include/asterisk/speech.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asterisk/speech.h b/include/asterisk/speech.h
index 0f1af151f..09d08ddb1 100644
--- a/include/asterisk/speech.h
+++ b/include/asterisk/speech.h
@@ -37,6 +37,11 @@ extern "C" {
#define AST_SPEECH_STATE_WAIT 2 /* Wait for results to become available */
#define AST_SPEECH_STATE_DONE 3 /* Processing is done */
+enum ast_speech_results_type {
+ AST_SPEECH_RESULTS_TYPE_NORMAL = 0,
+ AST_SPEECH_RESULTS_TYPE_NBEST,
+};
+
/* Speech structure */
struct ast_speech {
/*! Structure lock */
@@ -53,6 +58,8 @@ struct ast_speech {
void *data;
/*! Cached results */
struct ast_speech_result *results;
+ /*! Type of results we want */
+ enum ast_speech_results_type results_type;
/*! Pointer to the engine used by this speech structure */
struct ast_speech_engine *engine;
};
@@ -79,6 +86,8 @@ struct ast_speech_engine {
int (*start)(struct ast_speech *speech);
/*! Change an engine specific setting */
int (*change)(struct ast_speech *speech, char *name, const char *value);
+ /*! Change the type of results we want back */
+ int (*change_results_type)(struct ast_speech *speech, enum ast_speech_results_type results_type);
/*! Try to get results */
struct ast_speech_result *(*get)(struct ast_speech *speech);
/*! Accepted formats by the engine */
@@ -92,6 +101,8 @@ struct ast_speech_result {
char *text;
/*! Result score */
int score;
+ /*! NBest Alternative number if in NBest results type */
+ int nbest_num;
/*! Matched grammar */
char *grammar;
/*! List information */
@@ -120,6 +131,8 @@ int ast_speech_destroy(struct ast_speech *speech);
int ast_speech_write(struct ast_speech *speech, void *data, int len);
/*! \brief Change an engine specific attribute */
int ast_speech_change(struct ast_speech *speech, char *name, const char *value);
+/*! \brief Change the type of results we want */
+int ast_speech_change_results_type(struct ast_speech *speech, enum ast_speech_results_type results_type);
/*! \brief Change state of a speech structure */
int ast_speech_change_state(struct ast_speech *speech, int state);
/*! \brief Register a speech recognition engine */