23#ifndef _ASTERISK_SPEECH_H
24#define _ASTERISK_SPEECH_H
26#if defined(__cplusplus) || defined(c_plusplus)
84 int (*
load)(
struct ast_speech *speech,
const char *grammar_name,
const char *grammar);
166 void (*on_unregistered)(
void *obj));
168#if defined(__cplusplus) || defined(c_plusplus)
static int len(struct ast_channel *chan, const char *cmd, char *data, char *buf, size_t buflen)
static int should_unregister(const struct ast_speech_engine *engine, void *data)
struct ast_speech_engine * ast_speech_find_engine(const char *engine_name)
Retrieve a speech recognition engine.
int ast_speech_dtmf(struct ast_speech *speech, const char *dtmf)
Signal to the engine that DTMF was received.
int ast_speech_results_free(struct ast_speech_result *result)
Free a set of results.
int ast_speech_grammar_deactivate(struct ast_speech *speech, const char *grammar_name)
Deactivate a grammar on a speech structure.
const char * ast_speech_results_type_to_string(enum ast_speech_results_type type)
Convert a speech results type to a string.
int ast_speech_grammar_unload(struct ast_speech *speech, const char *grammar_name)
Unload a grammar.
void ast_speech_start(struct ast_speech *speech)
Indicate to the speech engine that audio is now going to start being written.
int ast_speech_unregister(const char *engine_name)
Unregister a speech recognition engine.
struct ast_speech_engine * ast_speech_unregister2(const char *engine_name)
Unregister a speech recognition engine.
int ast_speech_write(struct ast_speech *speech, void *data, int len)
Write audio to the speech engine.
int ast_speech_change(struct ast_speech *speech, const char *name, const char *value)
Change an engine specific attribute.
struct ast_speech * ast_speech_new(const char *engine_name, const struct ast_format_cap *formats)
Create a new speech structure.
void ast_speech_unregister_engines(int(*should_unregister)(const struct ast_speech_engine *engine, void *data), void *data, void(*on_unregistered)(void *obj))
Unregister all speech recognition engines told to by callback.
int ast_speech_destroy(struct ast_speech *speech)
Destroy a speech structure.
int ast_speech_change_results_type(struct ast_speech *speech, enum ast_speech_results_type results_type)
Change the type of results we want.
int ast_speech_grammar_load(struct ast_speech *speech, const char *grammar_name, const char *grammar)
Load a grammar on a speech structure (not globally)
int ast_speech_grammar_activate(struct ast_speech *speech, const char *grammar_name)
Activate a grammar on a speech structure.
int ast_speech_register(struct ast_speech_engine *engine)
Register a speech recognition engine.
int ast_speech_get_setting(struct ast_speech *speech, const char *name, char *buf, size_t len)
Get an engine specific attribute.
int ast_speech_change_state(struct ast_speech *speech, int state)
Change state of a speech structure.
@ AST_SPEECH_STATE_NOT_READY
@ AST_SPEECH_RESULTS_TYPE_NBEST
@ AST_SPEECH_RESULTS_TYPE_NORMAL
struct ast_speech_result * ast_speech_results_get(struct ast_speech *speech)
Get speech recognition results.
@ AST_SPEECH_HAVE_RESULTS
Structure for mutex and tracking information.
struct ast_format_cap * formats
int(* deactivate)(struct ast_speech *speech, const char *grammar_name)
int(* start)(struct ast_speech *speech)
int(* change_results_type)(struct ast_speech *speech, enum ast_speech_results_type results_type)
int(* get_setting)(struct ast_speech *speech, const char *name, char *buf, size_t len)
int(* destroy)(struct ast_speech *speech)
int(* dtmf)(struct ast_speech *speech, const char *dtmf)
int(* load)(struct ast_speech *speech, const char *grammar_name, const char *grammar)
int(* change)(struct ast_speech *speech, const char *name, const char *value)
int(* activate)(struct ast_speech *speech, const char *grammar_name)
int(* create)(struct ast_speech *speech, struct ast_format *format)
AST_LIST_ENTRY(ast_speech_engine) list
int(* write)(struct ast_speech *speech, void *data, int len)
int(* unload)(struct ast_speech *speech, const char *grammar_name)
AST_LIST_ENTRY(ast_speech_result) list
struct ast_format * format
struct ast_speech_engine * engine
enum ast_speech_results_type results_type
struct ast_speech_result * results