Expand description
Speech recognition API.
§Recognizer
The entry point for speech recognition is the Recognizer, which encapsulates an in-process
speech recognition engine. You generally won’t need more than one instance of the recognizer.
§Context
The recognizer can have one or more recognition contexts. This module provides two variants of contexts:
SyncContextwill block the current thread until the engine recognizes a phrase, or until the given timeout.EventfulContextwill call the supplied event handler whenever the engine recognizes a phrase.
For asynchronous recognition, see the tokio module.
§Grammar
Each context can have one or more grammars loaded into it. A grammar consists of one or more rules that define what phrases the engine can recognize. You can enable or disable the whole grammar, or individual rules in it by their name.
Structs§
- Context
- Provides the common API shared across different kinds of contexts.
- Eventful
Context - A recognition context that calls the supplied event handler every time the engine recognizes a phrase in it.
- Grammar
- A set of rules that define phrases that can be recognized.
- Grammar
Builder - Helper type that constructs a grammar from a set of top-level rules.
- Phrase
- A successfully recognized phrase.
- Recognizer
- The in-process speech recognition engine.
- Repeat
Range - Specifies the bounds for how many times the target rule in a
Rule::Repeatcan be repeated. - Rule
Arena - Allocation arena for grammar rules.
- Semantic
Tree - A tree of values that forms part of the semantic information for a recognized phrase.
- Sync
Context - A recognition context that blocks the current thread until the engine recognizes a phrase.
Enums§
- Recognition
Input - Specifies where the input for speech recognition should come from.
- Rule
- A rule that defines one or more phrases or fragments that can be recognized by the engine.
- Semantic
Value - A value that forms part of the semantic information for a recognized phrase.
Traits§
- Event
Handler - The handler
EventfulContextwill call. - Semantic
String - A string type that can be borrowed as an
OsStr.