#include <speechrecognitionutility.h>
| class CSpeechRecognitionUtility : public CBase |
This is the main class of Speech Recognition Utility.
| IMPORT_C TInt | AddPronunciation | ( | TLexiconID | aLexiconID, |
| TModelBankID | aModelBankID, | |||
| TModelID | aModelID, | |||
| TPronunciationID & | aPronunciationID | |||
| ) | ||||
Adds a new pronunciation for the given model into the specified lexicon.
| Parameter | Description |
|---|---|
| aLexiconID | The lexicon ID, where the new pronunciation is added to. |
| aModelBankID | The model bank ID. |
| aModelID | The model ID. |
| aPronunciationID | A reference where the new pronunciation ID is assigned to. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | AddRule | ( | TGrammarID | aGrammarID, |
| TLexiconID | aLexiconID, | |||
| TPronunciationID | aPronunciationID, | |||
| TRuleID & | aRuleID | |||
| ) | ||||
Adds a new rule for the given pronunciation into the specified grammar.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID, where the new rule is added to. |
| aLexiconID | The lexicon ID. |
| aPronunciationID | The pronunciation ID. |
| aRuleID | A reference where the new rule ID is assigned to. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | CommitChanges | ( | ) |
Commit the current train operation to the database.
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | CreateGrammar | ( | TGrammarID & | aGrammarID | ) |
Creates a new grammar.
| Parameter | Description |
|---|---|
| aGrammarID | A reference where grammar ID is stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | CreateLexicon | ( | TLexiconID & | aLexiconID | ) |
Creates a new lexicon.
| Parameter | Description |
|---|---|
| aLexiconID | A reference where lexicon ID is stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | CreateModelBank | ( | TModelBankID & | aModelBankID | ) |
Creates a new model bank.
| Parameter | Description |
|---|---|
| aModelBankID | A reference where a new model bank IF is assigned to. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | EndRecSession | ( | ) |
Ends the current recognition session. Resources allocated for recognition are freed.
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllClientGrammarIDs | ( | RArray< TGrammarID > & | aGrammarIDs | ) |
Returns all grammar IDs owned by the client.
| Parameter | Description |
|---|---|
| aGrammarIDs | A reference where rule IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllClientLexiconIDs | ( | RArray< TLexiconID > & | aLexiconIDs | ) |
Returns all lexicons owned by the client.
| Parameter | Description |
|---|---|
| aLexiconIDs | A reference where lexicon IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllClientModelBankIDs | ( | RArray< TModelBankID > & | aModelBankIDs | ) |
Returns all modelbank IDs owned by the client.
| Parameter | Description |
|---|---|
| aModelBankIDs | A reference where modelbank IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllGrammarIDs | ( | RArray< TGrammarID > & | aGrammarIDs | ) |
Returns all grammar IDs.
| Parameter | Description |
|---|---|
| aGrammarIDs | A reference where rule IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllLexiconIDs | ( | RArray< TLexiconID > & | aLexiconIDs | ) |
Returns all lexicons IDs.
| Parameter | Description |
|---|---|
| aLexiconIDs | A reference where lexicon IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllModelBankIDs | ( | RArray< TModelBankID > & | aModelBankIDs | ) |
Returns all modelbank IDs.
| Parameter | Description |
|---|---|
| aModelBankIDs | A reference where modelbank IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllModelIDs | ( | TModelBankID | aModelBankID, |
| RArray< TModelID > & | aModelIDs | |||
| ) | ||||
Returns all model IDs that exist in the specified model bank.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
| aModelIDs | A reference where model IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllPronunciationIDs | ( | TLexiconID | aLexiconID, |
| RArray< TPronunciationID > & | aPronunciationIDs | |||
| ) | ||||
Returns all pronunciation IDs that exist in the specified lexicon.
| Parameter | Description |
|---|---|
| aLexiconID | The lexicon ID. |
| aPronunciationIDs | A reference where pronunciation IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetAllRuleIDs | ( | TGrammarID | aGrammarID, |
| RArray< TRuleID > & | aRuleIDs | |||
| ) | ||||
Returns all rule IDs that exist in the specified grammar.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID. |
| aRuleIDs | A reference where rule IDs are stored. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
Returns the number of models available for training system model storage, based on available disk space.
| Parameter | Description |
|---|---|
| aAvailableStorage | The number of models that can be contained in available storage. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetEngineProperties | ( | const RArray< TInt > & | aPropertyId, |
| RArray< TInt > & | aPropertyValue | |||
| ) | ||||
Returns the engine properties specified by the engine property ID array. On return aPropertyValue contains an array of engine properties.
| Parameter | Description |
|---|---|
| aPropertyId | A constant reference to an array of engine property ID's. |
| aPropertyValue | A reference to an array of engine property values. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetModelCount | ( | TModelBankID | aModelBankID, |
| TInt & | aModelCount | |||
| ) | ||||
Returns the number of models in the specified model bank.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
| aModelCount | The reference where the number of models is set. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetRuleValidity | ( | TGrammarID | aGrammarID, |
| TRuleID | aRuleID, | |||
| TBool & | aValid | |||
| ) | ||||
Checks if the rule is valid or not.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID. |
| aRuleID | The rule ID. |
| aValid | A reference where the validity of the rule is set. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | GetUtteranceDuration | ( | TModelBankID | aModelBankID, |
| TModelID | aModelID, | |||
| TTimeIntervalMicroSeconds32 & | aDuration | |||
| ) | ||||
Returns the duration of the utterance for the specified model.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
| aModelID | The model ID. |
| aDuration | The reference where the duration of utterance is set. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | LoadEngineParameters | ( | const RArray< TInt > & | aParameterId, |
| const RArray< TInt > & | aParameterValue | |||
| ) | ||||
Loads the specified parameters into the recognition engine.
| Parameter | Description |
|---|---|
| aParameterId | The array of parameter IDs. |
| aParameterValue | The array of parameter values. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | LoadGrammar | ( | TGrammarID | aGrammarID | ) |
Loads the specified grammar into the recognizer; done prior to recognition.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | LoadLexicon | ( | TLexiconID | aLexiconID | ) |
Loads the specified lexicon into the recognizer; done prior to recognition.
| Parameter | Description |
|---|---|
| aLexiconID | The lexicon ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | LoadModels | ( | TModelBankID | aModelBankID | ) |
Loads the specified model bank into the recognizer; done prior to recognition.
| Parameter | Description |
|---|---|
| aModelBankID | The Model bank ID |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C CSpeechRecognitionUtility * | NewL | ( | MSpeechRecognitionUtilityObserver & | aSpeechRecognitionUtilityObserver, |
| TUid | aClientUid | |||
| ) | [static] | |||
Factory function for creating this class.
| Parameter | Description |
|---|---|
| aSpeechRecognitionUtilityObserver | A reference to the event observer class. |
| aClientUid | The UID of the client. |
Returns: A pointer to CSpeechRecognitionUtility object
| IMPORT_C CSpeechRecognitionUtility * | NewLC | ( | MSpeechRecognitionUtilityObserver & | aSpeechRecognitionUtilityObserver, |
| TUid | aClientUid | |||
| ) | [static] | |||
Factory function for creating this class. Leaves a pointer on the cleanup stack.
| Parameter | Description |
|---|---|
| aSpeechRecognitionUtilityObserver | A reference to the event observer class. |
| aClientUid | A client UID for data ownership. |
Returns: A pointer to a CSpeechRecognitionUtility object.
| IMPORT_C TInt | PlayUtterance | ( | TModelBankID | aModelBankID, |
| TModelID | aModelID | |||
| ) | ||||
Plays the previously trained utterance.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
| aModelID | The model ID, whose utterance is played. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | Recognize | ( | CSDClientResultSet & | aResultSet | ) |
Initiates recognition; performed following loading of model bank, lexicon, and grammar.
| Parameter | Description |
|---|---|
| aResultSet | A reference where the recognition result is set. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | Record | ( | TTimeIntervalMicroSeconds32 | aRecordTime | ) |
Records user utterance for training and recognition.
| Parameter | Description |
|---|---|
| aRecordTime | The recording time in microseconds. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | RemoveGrammar | ( | TGrammarID | aGrammarID | ) |
Removes the specified grammar from the permanent storage.
Removing a grammar will remove all rules within the grammar.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | RemoveLexicon | ( | TLexiconID | aLexiconID | ) |
Removes the specified lexicon from the permanent storage.
Removing a lexicon will remove all pronunciations within the lexicon.
| Parameter | Description |
|---|---|
| aLexiconID | The lexicon ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | RemoveModel | ( | TModelBankID | aModelBankID, |
| TModelID | aModelID | |||
| ) | ||||
Removes the specified model from the specified model bank permanently.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
| aModelID | The model ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | RemoveModelBank | ( | TModelBankID | aModelBankID | ) |
Removes the specified model bank from the permanent storage.
Removing a model bank will remove all models within the model bank.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | RemovePronunciation | ( | TLexiconID | aLexiconID, |
| TPronunciationID | aPronunciationID | |||
| ) | ||||
Removes the specified pronunciation from the specified lexicon permanently.
| Parameter | Description |
|---|---|
| aLexiconID | The lexicon ID. |
| aPronunciationID | The pronunciation ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | RemoveRule | ( | TGrammarID | aGrammarID, |
| TRuleID | aRuleID | |||
| ) | ||||
Removes the specified rule from the specified grammar permanently.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID. |
| aRuleID | The rule ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | SetAudioPriority | ( | TInt | aPriority, |
| TInt | aTrainPreference, | |||
| TInt | aPlaybackPreference, | |||
| TInt | aRecognitionPreference | |||
| ) | ||||
Sets the audio priority and preference for train, playback and recognition.
| Parameter | Description |
|---|---|
| aPriority | The priority for voice recognition. |
| aTrainPreference | The preference for training. |
| aPlaybackPreference | The preference for playback. |
| aRecognitionPreference | The preference for recognition. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C void | SetEventHandler | ( | MSpeechRecognitionUtilityObserver * | aSpeechRecognitionUtilityObserver | ) |
Sets the event handler for asynchronous events.
| Parameter | Description |
|---|---|
| aSpeechRecognitionUtilityObserver | A pointer to an observer. |
| IMPORT_C TInt | StartRecSession | ( | TRecognitionMode | aMode | ) |
Starts a new recognition session.
| Parameter | Description |
|---|---|
| aMode | The recognition mode. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | Train | ( | TModelBankID | aModelBankID, |
| TModelID & | aModelID | |||
| ) | ||||
Trains a new model into the specified model bank.
| Parameter | Description |
|---|---|
| aModelBankID | The model bank ID. |
| aModelID | A reference where a new model ID is assigned to. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.
| IMPORT_C TInt | UnloadRule | ( | TGrammarID | aGrammarID, |
| TRuleID | aRuleID | |||
| ) | ||||
Unloads the specified rule from the specified grammar in temporary memory, previously loaded with LoadGrammarL.
The rule in the permanent storage remains intact.
| Parameter | Description |
|---|---|
| aGrammarID | The grammar ID. |
| aRuleID | The rule ID. |
Returns: An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.