#include <SpeechRecognitionCustomCommands.h>
Link against:
speechrecognitioncustomcommands.lib
This item is not part of the S60 5th Edition SDK
Class RSpeechRecognitionCustomCommands
class RSpeechRecognitionCustomCommands : public RMMFCustomCommandsBase;
Description
This is the main class of Speech Recognition Custom Commands.
Derivation
RSpeechRecognitionCustomCommands
-
This is the main class of Speech Recognition Custom Commands.
Members
Defined in RSpeechRecognitionCustomCommands
:
AddPronunciation(TLexiconID,TModelBankID,TModelID,TPronunciationID &)
Adds a new pronunciation for the given model into the specified lexicon.
AddRule(TGrammarID,TLexiconID,TPronunciationID,TRuleID &)
Adds a new rule for the given pronunciation into the specified grammar.
Cancel()
Cancels the current operation.
CommitChanges()
Commits the current train operation to the database.
CreateGrammar(TGrammarID &)
Creates a new grammar.
CreateLexicon(TLexiconID &)
Creates a new lexicon.
CreateModelBank(TModelBankID &)
Creates a new model bank.
EndRecSession()
Ends the current recognition session.
GetAllClientGrammarIDs()
Returns all grammar IDs owned by the client.
GetAllClientLexiconIDs()
Returns all lexicon IDs owned by the client.
GetAllClientModelBankIDs()
Returns all modelBank IDs owned by the client.
GetAllGrammarIDs()
Returns all grammar IDs owned by the client.
GetAllLexiconIDs()
Returns all lexicon IDs owned by the client.
GetAllModelBankIDs()
Returns all modelBank IDs owned by the client.
GetAllModelIDs(TModelBankID)
Returns all model IDs that exist in the specified model bank.
GetAllPronunciationIDs(TLexiconID)
Returns all pronunciation IDs that exist in the specified lexicon.
GetAllRuleIDs(TGrammarID)
Returns all rule IDs that exist in the specified grammar.
GetAvailableStorage(TInt &)
Returns the number of models available for training system wide, based on availa...
GetEngineProperties(const RArray< TInt > &,RArray< TInt > &)
Returns the engine properties specified by the engine property ID array. On retu...
GetGrammarIDArrayL(RArray< TGrammarID > &)
Gets an array of grammar IDs previously requested by GetAllGrammarIDs.
GetLexiconIDArrayL(RArray< TLexiconID > &)
Gets an array of lexicon IDs previously requested by GetAllLexiconIDs.
GetModelBankIDArrayL(RArray< TModelBankID > &)
Gets an array of modelBank IDs previously requested by GetAllModelBankIDs.
GetModelCount(TModelBankID,TInt &)
Returns the number of models in the specified model bank.
GetModelIDArrayL(RArray< TModelID > &)
Gets an array of model IDs previously requested by GetAllModelIDs.
GetPronunciationIDArrayL(RArray< TPronunciationID > &)
Gets an array of pronunciation IDs previously requested by GetAllPronunciationID...
GetResultSetL(CSDClientResultSet &)
Gets a client result set previously created by a call to Recognise().
GetRuleIDArrayL(RArray< TRuleID > &)
Gets an array of rule IDs previously requested by GetAllRuleIDs.
GetRuleValidity(TGrammarID,TRuleID,TBool &)
Checks if the rule is valid or not.
GetUtteranceDuration(TModelBankID,TModelID,TTimeIntervalMicroSeconds32 &)
Returns the duration of the utterance for the specified model.
LoadEngineParameters(const RArray< TInt > &,const RArray< TInt > &)
Uploads the specified parameters into the engine.
LoadGrammar(TGrammarID)
Loads the specified grammar into the recognizer; done prior to recognition.
LoadLexicon(TLexiconID)
Loads the specified lexicon into the recognizer; done prior to recognition.
LoadModels(TModelBankID)
Loads the specified model bank into the recognizer; done prior to recognition.
PlayUtterance(TModelBankID,TModelID)
Plays the previously trained utterance.
RSpeechRecognitionCustomCommands(RMMFController &)
Public C++ constructor for RSpeechRecognitionCustomCommands class.
Recognize(CSDClientResultSet &)
Initiates recognition; performed following loading of model bank, lexicon, and g...
Record(TTimeIntervalMicroSeconds32)
Records the user utterance for training and recognition.
RemoveGrammar(TGrammarID)
Removes the specified grammar from the permanent storage.
RemoveLexicon(TLexiconID)
Removes the specified lexicon from the permanent storage.
RemoveModel(TModelBankID,TModelID)
Removes the specified model from the specified model bank permanently.
RemoveModelBank(TModelBankID)
Removes the specified model bank from the permanent storage.
RemovePronunciation(TLexiconID,TPronunciationID)
Removes the specified pronunciation from the specified lexicon permanently.
RemoveRule(TGrammarID,TRuleID)
Removes the specified rule from the specified grammar permanently.
SetClientUid(TUid)
Sets the client UID for client.
StartRecSession(TRecognitionMode)
Starts a new recognition session.
Train(TModelBankID,TModelID &)
Trains a new model into the specified model bank.
UnloadRule(TGrammarID,TRuleID)
Unloads the specified rule from the specified grammar in temporary memory, previ...
Inherited from RMMFCustomCommandsBase
:
Construction and destruction
RSpeechRecognitionCustomCommands(RMMFController &)
IMPORT_C RSpeechRecognitionCustomCommands(RMMFController &aController);
Description
Public C++ constructor for RSpeechRecognitionCustomCommands class.
Parameters
AddPronunciation(TLexiconID,TModelBankID,TModelID,TPronunciationID &)
IMPORT_C TInt AddPronunciation(TLexiconID aLexiconID, TModelBankID aModelBankID, TModelID aModelID, TPronunciationID &aPronunciationID);
Description
Adds a new pronunciation for the given model into the specified lexicon.
Parameters
TLexiconID aLexiconID |
The lexicon ID to where the new pronunciation is added.
|
TModelBankID aModelBankID |
The model bank ID.
|
TModelID aModelID |
The model ID.
|
TPronunciationID &aPronunciationID |
A reference to where a new pronunciation ID is assigned.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
AddRule(TGrammarID,TLexiconID,TPronunciationID,TRuleID &)
IMPORT_C TInt AddRule(TGrammarID aGrammarID, TLexiconID aLexiconID, TPronunciationID aPronunciationID, TRuleID &aRuleID);
Description
Adds a new rule for the given pronunciation into the specified grammar.
Parameters
TGrammarID aGrammarID |
The grammar ID to where the new rule is added.
|
TLexiconID aLexiconID |
The lexicon ID.
|
TPronunciationID aPronunciationID |
The pronunciation ID.
|
TRuleID &aRuleID |
A reference to where a new rule ID is assigned.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
IMPORT_C void Cancel();
Description
Cancels the current operation.
IMPORT_C TInt CommitChanges();
Description
Commits the current train operation to the database.
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
CreateGrammar(TGrammarID &)
IMPORT_C TInt CreateGrammar(TGrammarID &aGrammarID);
Description
Creates a new grammar.
Parameters
TGrammarID &aGrammarID |
A reference to where the grammar ID is stored.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
CreateLexicon(TLexiconID &)
IMPORT_C TInt CreateLexicon(TLexiconID &aLexiconID);
Description
Creates a new lexicon.
Parameters
TLexiconID &aLexiconID |
A reference where lexicon ID is stored.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
CreateModelBank(TModelBankID &)
IMPORT_C TInt CreateModelBank(TModelBankID &aModelBankID);
Description
Creates a new model bank.
Parameters
TModelBankID &aModelBankID |
A reference to where a new model bank ID is assigned.
|
|
Return value
TInt
|
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();
Description
Ends the current recognition session.
The resources allocated for recognition are freed.
Return value
TInt
|
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();
Description
Returns all grammar IDs owned by the client.
Return value
TInt
|
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();
Description
Returns all lexicon IDs owned by the client.
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetAllClientModelBankIDs()
IMPORT_C TInt GetAllClientModelBankIDs();
Description
Returns all modelBank IDs owned by the client.
Return value
TInt
|
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();
Description
Returns all grammar IDs owned by the client.
Return value
TInt
|
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();
Description
Returns all lexicon IDs owned by the client.
Return value
TInt
|
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();
Description
Returns all modelBank IDs owned by the client.
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetAllModelIDs(TModelBankID)
IMPORT_C TInt GetAllModelIDs(TModelBankID aModelBankID);
Description
Returns all model IDs that exist in the specified model bank.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetAllPronunciationIDs(TLexiconID)
IMPORT_C TInt GetAllPronunciationIDs(TLexiconID aLexiconID);
Description
Returns all pronunciation IDs that exist in the specified lexicon.
Parameters
TLexiconID aLexiconID |
The lexicon ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetAllRuleIDs(TGrammarID)
IMPORT_C TInt GetAllRuleIDs(TGrammarID aGrammarID);
Description
Returns all rule IDs that exist in the specified grammar.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetAvailableStorage(TInt &)
IMPORT_C TInt GetAvailableStorage(TInt &aAvailableStorage);
Description
Returns the number of models available for training system wide, based on available disk space.
Parameters
TInt &aAvailableStorage |
The number of models that can be held in available storage space.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetEngineProperties(const RArray< TInt > &,RArray< TInt > &)
IMPORT_C TInt GetEngineProperties(const RArray< TInt > &aPropertyId, RArray< TInt > &aPropertyValue);
Description
Returns the engine properties specified by the engine property ID array. On return aPropertyValue contains an array of engine
properties.
Parameters
const RArray < TInt > &aPropertyId |
A constant reference to an array of engine property IDs.
|
RArray < TInt > &aPropertyValue |
A reference to an array of engine property values.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetModelCount(TModelBankID,TInt &)
IMPORT_C TInt GetModelCount(TModelBankID aModelBankID, TInt &aModelCount);
Description
Returns the number of models in the specified model bank.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
TInt &aModelCount |
The reference where the number of models is set.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetRuleValidity(TGrammarID,TRuleID,TBool &)
IMPORT_C TInt GetRuleValidity(TGrammarID aGrammarID, TRuleID aRuleID, TBool &aValid);
Description
Checks if the rule is valid or not.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
TRuleID aRuleID |
The rule ID.
|
TBool &aValid |
A reference where the validity of the rule is set.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetUtteranceDuration(TModelBankID,TModelID,TTimeIntervalMicroSeconds32 &)
IMPORT_C TInt GetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID, TTimeIntervalMicroSeconds32 &aDuration);
Description
Returns the duration of the utterance for the specified model.
Parameters
TModelBankID aModelBankID |
model bank Id
|
TModelID aModelID |
model Id
|
TTimeIntervalMicroSeconds32 &aDuration |
reference where the duration of utterance is set
|
|
Return value
IMPORT_C TInt LoadGrammar(TGrammarID aGrammarID);
Description
Loads the specified grammar into the recognizer; done prior to recognition.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
|
Return value
TInt
|
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);
Description
Loads the specified lexicon into the recognizer; done prior to recognition.
Parameters
TLexiconID aLexiconID |
The lexicon ID.
|
|
Return value
TInt
|
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);
Description
Loads the specified model bank into the recognizer; done prior to recognition.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
PlayUtterance(TModelBankID,TModelID)
IMPORT_C TInt PlayUtterance(TModelBankID aModelBankID, TModelID aModelID);
Description
Plays the previously trained utterance.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
TModelID aModelID |
The model ID, whose utterance is played.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
Recognize(CSDClientResultSet &)
IMPORT_C TInt Recognize(CSDClientResultSet &aResultSet);
Description
Initiates recognition; performed following loading of model bank, lexicon, and grammar.
Parameters
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
Record(TTimeIntervalMicroSeconds32)
IMPORT_C TInt Record(TTimeIntervalMicroSeconds32 aRecordTime);
Description
Records the user utterance for training and recognition.
Parameters
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
RemoveGrammar(TGrammarID)
IMPORT_C TInt RemoveGrammar(TGrammarID aGrammarID);
Description
Removes the specified grammar from the permanent storage.
Removing a grammar will remove all rules within the grammar.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
RemoveLexicon(TLexiconID)
IMPORT_C TInt RemoveLexicon(TLexiconID aLexiconID);
Description
Removes the specified lexicon from the permanent storage.
Removing a lexicon will remove all pronunciations within the lexicon.
Parameters
TLexiconID aLexiconID |
The lexicon ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
RemoveModelBank(TModelBankID)
IMPORT_C TInt RemoveModelBank(TModelBankID aModelBankID);
Description
Removes the specified model bank from the permanent storage.
Removing a model bank will remove all models within the model bank.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
RemoveModel(TModelBankID,TModelID)
IMPORT_C TInt RemoveModel(TModelBankID aModelBankID, TModelID aModelID);
Description
Removes the specified model from the specified model bank permanently.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
TModelID aModelID |
The model ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
RemovePronunciation(TLexiconID,TPronunciationID)
IMPORT_C TInt RemovePronunciation(TLexiconID aLexiconID, TPronunciationID aPronunciationID);
Description
Removes the specified pronunciation from the specified lexicon permanently.
Parameters
TLexiconID aLexiconID |
The lexicon ID.
|
TPronunciationID aPronunciationID |
The pronunciation ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
RemoveRule(TGrammarID,TRuleID)
IMPORT_C TInt RemoveRule(TGrammarID aGrammarID, TRuleID aRuleID);
Description
Removes the specified rule from the specified grammar permanently.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
TRuleID aRuleID |
The rule ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
IMPORT_C TInt SetClientUid(TUid aClientUid);
Description
Sets the client UID for client.
Parameters
TUid aClientUid |
The client UID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
StartRecSession(TRecognitionMode)
IMPORT_C TInt StartRecSession(TRecognitionMode aMode);
Description
Starts a new recognition session.
Parameters
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
Train(TModelBankID,TModelID &)
IMPORT_C TInt Train(TModelBankID aModelBankID, TModelID &aModelID);
Description
Trains a new model into the specified model bank.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
TModelID &aModelID |
The reference to where a new model ID is assigned.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
UnloadRule(TGrammarID,TRuleID)
IMPORT_C TInt UnloadRule(TGrammarID aGrammarID, TRuleID aRuleID);
Description
Unloads the specified rule from the specified grammar in temporary memory, previously loaded with LoadGrammarL(). The rule
in the permanent storage remains intact.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
TRuleID aRuleID |
The rule ID.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
LoadEngineParameters(const RArray< TInt > &,const RArray< TInt > &)
IMPORT_C TInt LoadEngineParameters(const RArray< TInt > &aParameterId, const RArray< TInt > &aParameterValue);
Description
Uploads the specified parameters into the engine.
Parameters
const RArray < TInt > &aParameterId |
An array of parameter IDs.
|
const RArray < TInt > &aParameterValue |
An array of parameter values.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|
GetPronunciationIDArrayL(RArray< TPronunciationID > &)
IMPORT_C void GetPronunciationIDArrayL(RArray< TPronunciationID > &aPronunciationIDs);
Description
Gets an array of pronunciation IDs previously requested by GetAllPronunciationIDs.
Parameters
RArray < TPronunciationID > &aPronunciationIDs |
An array to store pronunciation IDs.
|
|
GetRuleIDArrayL(RArray< TRuleID > &)
IMPORT_C void GetRuleIDArrayL(RArray< TRuleID > &aRuleIDs);
Description
Gets an array of rule IDs previously requested by GetAllRuleIDs.
Parameters
RArray < TRuleID > &aRuleIDs |
An array to store rule IDs.
|
|
GetModelIDArrayL(RArray< TModelID > &)
IMPORT_C void GetModelIDArrayL(RArray< TModelID > &aModelIDs);
Description
Gets an array of model IDs previously requested by GetAllModelIDs.
Parameters
RArray < TModelID > &aModelIDs |
An array to store model IDs.
|
|
GetGrammarIDArrayL(RArray< TGrammarID > &)
IMPORT_C void GetGrammarIDArrayL(RArray< TGrammarID > &aGrammarIDs);
Description
Gets an array of grammar IDs previously requested by GetAllGrammarIDs.
Parameters
RArray < TGrammarID > &aGrammarIDs |
An array to store grammar IDs.
|
|
GetLexiconIDArrayL(RArray< TLexiconID > &)
IMPORT_C void GetLexiconIDArrayL(RArray< TLexiconID > &aLexiconIDs);
Description
Gets an array of lexicon IDs previously requested by GetAllLexiconIDs.
Parameters
RArray < TLexiconID > &aLexiconIDs |
An array to store lexicon IDs.
|
|
GetModelBankIDArrayL(RArray< TModelBankID > &)
IMPORT_C void GetModelBankIDArrayL(RArray< TModelBankID > &aModelBankIDs);
Description
Gets an array of modelBank IDs previously requested by GetAllModelBankIDs.
Parameters
RArray < TModelBankID > &aModelBankIDs |
An array to store modelBank IDs.
|
|
GetResultSetL(CSDClientResultSet &)
IMPORT_C void GetResultSetL(CSDClientResultSet &aResultSet);
Description
Gets a client result set previously created by a call to Recognise().
Parameters