»
Symbian OS v9.3 »
Symbian OS reference »
C++ component reference »
Multimedia MMF »
CSpeechRecognitionUtility
Location:
speechrecognitionutility.h
Link against: speechrecognitionutility.lib
This item is not part of the S60 3rd Edition SDK for Symbian OS, Feature Pack 2.
Class CSpeechRecognitionUtility
class CSpeechRecognitionUtility : public CBase;
Description
This is the main class of Speech Recognition Utility.
Derivation
CBase
- Base class for all classes to be instantiated on the heap
CSpeechRecognitionUtility
- This is the main class of Speech Recognition Utility
Members
Defined in CSpeechRecognitionUtility
:
AddPronunciation()
, AddRule()
, Cancel()
, CommitChanges()
, CreateGrammar()
, CreateLexicon()
, CreateModelBank()
, EndRecSession()
, GetAllClientGrammarIDs()
, GetAllClientLexiconIDs()
, GetAllClientModelBankIDs()
, GetAllGrammarIDs()
, GetAllLexiconIDs()
, GetAllModelBankIDs()
, GetAllModelIDs()
, GetAllPronunciationIDs()
, GetAllRuleIDs()
, GetAvailableStorage()
, GetEngineProperties()
, GetModelCount()
, GetRuleValidity()
, GetUtteranceDuration()
, LoadEngineParameters()
, LoadGrammar()
, LoadLexicon()
, LoadModels()
, NewL()
, NewLC()
, PlayUtterance()
, Recognize()
, Record()
, RemoveGrammar()
, RemoveLexicon()
, RemoveModel()
, RemoveModelBank()
, RemovePronunciation()
, RemoveRule()
, SetAudioPriority()
, SetEventHandler()
, StartRecSession()
, Train()
, UnloadRule()
, ~CSpeechRecognitionUtility()
Inherited from CBase
:
Delete()
,
Extension_()
,
operator new()
Construction and destruction
static IMPORT_C CSpeechRecognitionUtility *NewL(MSpeechRecognitionUtilityObserver &aSpeechRecognitionUtilityObserver, TUid
aClientUid);
Description
Factory function for creating this class.
Parameters
Return value
static IMPORT_C CSpeechRecognitionUtility *NewLC(MSpeechRecognitionUtilityObserver &aSpeechRecognitionUtilityObserver, TUid
aClientUid);
Description
Factory function for creating this class. Leaves a pointer on the cleanup stack.
Parameters
Return value
~CSpeechRecognitionUtility()
IMPORT_C ~CSpeechRecognitionUtility();
Description
Destructor.
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 ID's.
|
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.
|
|
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, where the new pronunciation is added to.
|
TModelBankID aModelBankID |
The model bank ID.
|
TModelID aModelID |
The model ID.
|
TPronunciationID &aPronunciationID |
A reference where the new pronunciation ID is assigned to.
|
|
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 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, where the new rule is added to.
|
TLexiconID aLexiconID |
The lexicon ID.
|
TPronunciationID aPronunciationID |
The pronunciation ID.
|
TRuleID &aRuleID |
A reference where the new rule ID is assigned to.
|
|
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
Commit 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.
|
|
IMPORT_C TInt CreateGrammar(TGrammarID &aGrammarID);
Description
Creates a new grammar.
Parameters
TGrammarID &aGrammarID |
A reference where 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.
|
|
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.
|
|
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.
|
|
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 GetUtteranceDuration(TModelBankID aModelBankID, TModelID aModelID, TTimeIntervalMicroSeconds32 &aDuration);
Description
Returns the duration of the utterance for the specified model.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
TModelID aModelID |
The model ID.
|
TTimeIntervalMicroSeconds32 &aDuration |
The reference where the duration of utterance 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.
|
|
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.
|
|
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.
|
|
IMPORT_C TInt EndRecSession();
Description
Ends the current recognition session. 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 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.
|
|
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.
|
|
IMPORT_C TInt Record(TTimeIntervalMicroSeconds32 aRecordTime);
Description
Records 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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 Train(TModelBankID aModelBankID, TModelID &aModelID);
Description
Trains a new model into the specified model bank.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
TModelID &aModelID |
A reference where a new model ID is assigned to.
|
|
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 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.
|
|
IMPORT_C void SetEventHandler(MSpeechRecognitionUtilityObserver *aSpeechRecognitionUtilityObserver);
Description
Sets the event handler for asynchronous events.
Parameters
IMPORT_C TInt GetAllPronunciationIDs(TLexiconID aLexiconID, RArray< TPronunciationID > &aPronunciationIDs);
Description
Returns all pronunciation IDs that exist in the specified lexicon.
Parameters
TLexiconID aLexiconID |
The lexicon ID.
|
RArray < TPronunciationID > &aPronunciationIDs |
A reference where pronunciation IDs are 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.
|
|
IMPORT_C TInt GetAllClientGrammarIDs(RArray< TGrammarID > &aGrammarIDs);
Description
Returns all grammar IDs owned by the client.
Parameters
RArray < TGrammarID > &aGrammarIDs |
A reference where rule IDs are 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.
|
|
IMPORT_C TInt GetAllClientLexiconIDs(RArray< TLexiconID > &aLexiconIDs);
Description
Returns all lexicons owned by the client.
Parameters
RArray < TLexiconID > &aLexiconIDs |
A reference where lexicon IDs are 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.
|
|
GetAllClientModelBankIDs()
IMPORT_C TInt GetAllClientModelBankIDs(RArray< TModelBankID > &aModelBankIDs);
Description
Returns all modelbank IDs owned by the client.
Parameters
RArray < TModelBankID > &aModelBankIDs |
A reference where modelbank IDs are 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.
|
|
IMPORT_C TInt GetAllGrammarIDs(RArray< TGrammarID > &aGrammarIDs);
Description
Returns all grammar IDs.
Parameters
RArray < TGrammarID > &aGrammarIDs |
A reference where rule IDs are 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.
|
|
IMPORT_C TInt GetAllLexiconIDs(RArray< TLexiconID > &aLexiconIDs);
Description
Returns all lexicons IDs.
Parameters
RArray < TLexiconID > &aLexiconIDs |
A reference where lexicon IDs are 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.
|
|
IMPORT_C TInt GetAllModelBankIDs(RArray< TModelBankID > &aModelBankIDs);
Description
Returns all modelbank IDs.
Parameters
RArray < TModelBankID > &aModelBankIDs |
A reference where modelbank IDs are 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.
|
|
IMPORT_C TInt GetAllModelIDs(TModelBankID aModelBankID, RArray< TModelID > &aModelIDs);
Description
Returns all model IDs that exist in the specified model bank.
Parameters
TModelBankID aModelBankID |
The model bank ID.
|
RArray < TModelID > &aModelIDs |
A reference where model IDs are 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.
|
|
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.
|
|
IMPORT_C TInt GetAllRuleIDs(TGrammarID aGrammarID, RArray< TRuleID > &aRuleIDs);
Description
Returns all rule IDs that exist in the specified grammar.
Parameters
TGrammarID aGrammarID |
The grammar ID.
|
RArray < TRuleID > &aRuleIDs |
A reference where rule IDs are 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.
|
|
IMPORT_C TInt CreateModelBank(TModelBankID &aModelBankID);
Description
Creates a new model bank.
Parameters
TModelBankID &aModelBankID |
A reference where a new model bank IF is assigned to.
|
|
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 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.
|
|
IMPORT_C TInt GetAvailableStorage(TInt &aAvailableStorage);
Description
Returns the number of models available for training system model storage, based on available disk space.
Parameters
TInt &aAvailableStorage |
The number of models that can be contained in available storage.
|
|
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 LoadEngineParameters(const RArray< TInt > &aParameterId, const RArray< TInt > &aParameterValue);
Description
Loads the specified parameters into the recognition engine.
Parameters
const RArray < TInt > &aParameterId |
The array of parameter IDs.
|
const RArray < TInt > &aParameterValue |
The 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.
|
|
Capability: |
MultimediaDD |
A process requesting or using this method that has MultimediaDD capability will always have precedence over a process that
does not have MultimediaDD.
|
IMPORT_C TInt SetAudioPriority(TInt aPriority, TInt aTrainPreference, TInt aPlaybackPreference, TInt aRecognitionPreference);
Description
Sets the audio priority and preference for train, playback and recognition.
Parameters
TInt aPriority |
The priority for voice recognition.
|
TInt aTrainPreference |
The preference for training.
|
TInt aPlaybackPreference |
The preference for playback.
|
TInt aRecognitionPreference |
The preference for recognition.
|
|
Return value
TInt
|
An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error
codes.
|
|