MSISpeechRecognitionUtilityBase Class Reference

class MSISpeechRecognitionUtilityBase
Public Member Functions
~MSISpeechRecognitionUtilityBase()
TInt ActivateGrammar(TSIGrammarID)
TInt Adapt(const CSIClientResultSet &, TInt)
TInt AddPronunciation(TSILexiconID, const TDesC &, TLanguage, TSIPronunciationID &)
TInt AddRule(TSIGrammarID, TSILexiconID, TSIPronunciationID, TSIRuleID &)
TInt AddRuleVariant(TSIGrammarID, TSILexiconID, RArray< TSIPronunciationID > &, TSIRuleID, TSIRuleVariantID &)
TInt AddVoiceTag(MDesCArray &, const RArray< TLanguage > &, TSILexiconID, TSIGrammarID, TSIRuleID &)
TInt AddVoiceTag(MDesCArray &, const RArray< RLanguageArray > &, TSILexiconID, TSIGrammarID, TSIRuleID &)
TInt AddVoiceTags(const RPointerArray< MDesCArray > &, const RArray< TLanguage > &, TSILexiconID, TSIGrammarID, RArray< TSIRuleID > &)
TInt AddVoiceTags(const RPointerArray< MDesCArray > &, const RArray< RLanguageArray > &, TSILexiconID, TSIGrammarID, RArray< TSIRuleID > &)
voidCancel()
TInt CommitChanges()
TInt CreateGrammar(TSIGrammarID &)
voidCreateInstanceSecondPhaseL(TUid, TUid, MSISpeechRecognitionUtilityObserver &)
TInt CreateLexicon(TSILexiconID &)
TInt CreateModelBank(TSIModelBankID &)
TInt CreateRule(TSIGrammarID, TSIRuleID &)
TInt DeactivateGrammar(TSIGrammarID)
TInt EndRecSession()
TInt EndRecord()
TInt GetAllClientGrammarIDs(RArray< TSIGrammarID > &)
TInt GetAllClientLexiconIDs(RArray< TSILexiconID > &)
TInt GetAllClientModelBankIDs(RArray< TSIModelBankID > &)
TInt GetAllGrammarIDs(RArray< TSIGrammarID > &)
TInt GetAllLexiconIDs(RArray< TSILexiconID > &)
TInt GetAllModelBankIDs(RArray< TSIModelBankID > &)
TInt GetAllModelIDs(TSIModelBankID, RArray< TSIModelID > &)
TInt GetAllPronunciationIDs(TSILexiconID, RArray< TSIPronunciationID > &)
TInt GetAllRuleIDs(TSIGrammarID, RArray< TSIRuleID > &)
TInt GetEngineProperties(const RArray< TInt > &, RArray< TInt > &)
TInt GetModelCount(TSIModelBankID, TInt &)
TInt GetRuleValidity(TSIGrammarID, TSIRuleID, TBool &)
TInt LoadEngineParameters(const RArray< TInt > &, const RArray< TInt > &)
TInt LoadGrammar(TSIGrammarID)
TInt LoadLexicon(TSILexiconID)
TInt LoadModels(TSIModelBankID)
TInt PreStartSampling()
TInt Recognize(CSIClientResultSet &)
TInt Record(TTimeIntervalMicroSeconds32)
TInt RemoveGrammar(TSIGrammarID)
TInt RemoveLexicon(TSILexiconID)
TInt RemoveModel(TSIModelBankID, TSIModelID)
TInt RemoveModelBank(TSIModelBankID)
TInt RemovePronunciation(TSILexiconID, TSIPronunciationID)
TInt RemoveRule(TSIGrammarID, TSIRuleID)
TInt RemoveRules(TSIGrammarID, RArray< TSIRuleID > &)
TInt SetAudioPriority(TInt, TInt, TInt, TInt)
voidSetEventHandler(MSISpeechRecognitionUtilityObserver *)
TInt StartRecSession(TNSSRecognitionMode)
TInt UnloadGrammar(TSIGrammarID)
TInt UnloadRule(TSIGrammarID, TSIRuleID)

Constructor & Destructor Documentation

~MSISpeechRecognitionUtilityBase()

~MSISpeechRecognitionUtilityBase()[inline, virtual]

Destructor. Defined here so that client can use M-class pointer to destroy the concrete C-object

Member Functions Documentation

ActivateGrammar(TSIGrammarID)

TInt ActivateGrammar(TSIGrammarIDaGrammarID)[pure virtual]

Reactivates a previously deactivated grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar ID

Adapt(const CSIClientResultSet &, TInt)

TInt Adapt(const CSIClientResultSet &aResultSet,
TIntaCorrect
)[pure virtual]

Adapts the speaker independent models to a specific speaker's voice.

Since
3.1

Parameters

const CSIClientResultSet & aResultSetRecognition result N-Best
TInt aCorrectIndex to N-Best pointing the correct result.

AddPronunciation(TSILexiconID, const TDesC &, TLanguage, TSIPronunciationID &)

TInt AddPronunciation(TSILexiconIDaLexiconID,
const TDesC &aTextForTraining,
TLanguageaLanguage,
TSIPronunciationID &aPronunciationID
)[pure virtual]

Adds a new pronunciation for the given text phrase into the specified lexicon.

Since
3.1

Parameters

TSILexiconID aLexiconIDlexicon Id, where the new pronunciation is added to
const TDesC & aTextForTrainingText to be trained
TLanguage aLanguagePronunciation language
TSIPronunciationID & aPronunciationIDreference where a new pronunciation Id is assigned to

AddRule(TSIGrammarID, TSILexiconID, TSIPronunciationID, TSIRuleID &)

TInt AddRule(TSIGrammarIDaGrammarID,
TSILexiconIDaLexiconID,
TSIPronunciationIDaPronunciationID,
TSIRuleID &aRuleID
)[pure virtual]

Adds a new rule for the given pronunciation into the specified grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id, where the new rule is added to
TSILexiconID aLexiconIDlexicon Id
TSIPronunciationID aPronunciationIDpronunciation Id
TSIRuleID & aRuleIDreference where a new rule Id is assigned to

AddRuleVariant(TSIGrammarID, TSILexiconID, RArray< TSIPronunciationID > &, TSIRuleID, TSIRuleVariantID &)

TInt AddRuleVariant(TSIGrammarIDaGrammarID,
TSILexiconIDaLexiconID,
RArray< TSIPronunciationID > &aPronunciationIDs,
TSIRuleIDaRuleID,
TSIRuleVariantID &aRuleVariantID
)[pure virtual]

Adds a new rule variant for the given pronunciation into the specified grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id, where the new rule is added to
TSILexiconID aLexiconID
RArray< TSIPronunciationID > & aPronunciationIDsthe phrase is the concatenation of these pronunciation IDs
TSIRuleID aRuleIDthe rule Id, which will contain this variant
TSIRuleVariantID & aRuleVariantIDreference where a new rule variant Id is assigned to

AddVoiceTag(MDesCArray &, const RArray< TLanguage > &, TSILexiconID, TSIGrammarID, TSIRuleID &)

TInt AddVoiceTag(MDesCArray &aTextArray,
const RArray< TLanguage > &aLanguageArray,
TSILexiconIDaLexiconID,
TSIGrammarIDaGrammarID,
TSIRuleID &aRuleID
)[pure virtual]

Adds a new rule for the given phrase into the specified grammar.

Since
3.1

Parameters

MDesCArray & aTextArraythe text to be trained, divided in to words. The phrase is the concatenation of these words.
const RArray< TLanguage > & aLanguageArraypronunciations will be generated for these languages
TSILexiconID aLexiconIDlexicon, where to add pronunciations
TSIGrammarID aGrammarIDgrammar, where to add rules
TSIRuleID & aRuleIDthe ID of the rule will be placed on this variable.

AddVoiceTag(MDesCArray &, const RArray< RLanguageArray > &, TSILexiconID, TSIGrammarID, TSIRuleID &)

TInt AddVoiceTag(MDesCArray &aTextArray,
const RArray< RLanguageArray > &aLanguageArray,
TSILexiconIDaLexiconID,
TSIGrammarIDaGrammarID,
TSIRuleID &aRuleID
)[pure virtual]

Adds a new rule for the given phrase into the specified grammar.

Since
3.1

Parameters

MDesCArray & aTextArrayThe text to be trained, divided in to words. The phrase is the concatenation of these words.
const RArray< RLanguageArray > & aLanguageArrayPronunciations will be generated for these languages
TSILexiconID aLexiconIDLexicon, where to add pronunciations
TSIGrammarID aGrammarIDGrammar, where to add rules
TSIRuleID & aRuleIDThe ID of the rule will be placed on this variable.

AddVoiceTags(const RPointerArray< MDesCArray > &, const RArray< TLanguage > &, TSILexiconID, TSIGrammarID, RArray< TSIRuleID > &)

TInt AddVoiceTags(const RPointerArray< MDesCArray > &aTextArrayArray,
const RArray< TLanguage > &aLanguageArray,
TSILexiconIDaLexiconID,
TSIGrammarIDaGrammarID,
RArray< TSIRuleID > &aRuleIDArray
)[pure virtual]

Adds a new rules for the given phrases into the specified grammar.

Since
3.1

Parameters

const RPointerArray< MDesCArray > & aTextArrayArrayArray of text arrays. The phrase k is the concatenation of texts in array k.
const RArray< TLanguage > & aLanguageArraypronunciations will be generated for these languages
TSILexiconID aLexiconIDlexicon, where to add pronunciations
TSIGrammarID aGrammarIDgrammar, where to add rules
RArray< TSIRuleID > & aRuleIDArray

AddVoiceTags(const RPointerArray< MDesCArray > &, const RArray< RLanguageArray > &, TSILexiconID, TSIGrammarID, RArray< TSIRuleID > &)

TInt AddVoiceTags(const RPointerArray< MDesCArray > &aTextArrayArray,
const RArray< RLanguageArray > &aLanguageArray,
TSILexiconIDaLexiconID,
TSIGrammarIDaGrammarID,
RArray< TSIRuleID > &aRuleIDArray
)[pure virtual]

Adds a new rules for the given phrases into the specified grammar.

Since
3.1

Parameters

const RPointerArray< MDesCArray > & aTextArrayArrayArray of text arrays. The phrase k is the concatenation of texts in array k.
const RArray< RLanguageArray > & aLanguageArraypronunciations will be generated for these languages
TSILexiconID aLexiconIDlexicon, where to add pronunciations
TSIGrammarID aGrammarIDgrammar, where to add rules
RArray< TSIRuleID > & aRuleIDArray

Cancel()

voidCancel()[pure virtual]

Cancels the current operation

Since
3.1

CommitChanges()

TInt CommitChanges()[pure virtual]

Saves the changes into a permanent storage.

Since
3.1

CreateGrammar(TSIGrammarID &)

TInt CreateGrammar(TSIGrammarID &aGrammarID)[pure virtual]

Creates a new grammar.

Since
3.1

Parameters

TSIGrammarID & aGrammarIDreference where grammar ID is stored

CreateInstanceSecondPhaseL(TUid, TUid, MSISpeechRecognitionUtilityObserver &)

voidCreateInstanceSecondPhaseL(TUidaClientUid,
TUidaPluginUid,
MSISpeechRecognitionUtilityObserver &aObserver
)[pure virtual]

Second phase construction. Needed when dynamically loading nsssispeechrecognitionutility.dll Direct users of CSISpeechRecognitionUtility should not use this.

Since
3.1

Parameters

TUid aClientUidClient UID for data ownership, other clients won't be able to modify the data registered to certain client
TUid aPluginUidUID of the plugin which will be used, KNullUid to search for suitable plugin
MSISpeechRecognitionUtilityObserver & aObserverCallback observer reference

CreateLexicon(TSILexiconID &)

TInt CreateLexicon(TSILexiconID &aLexiconID)[pure virtual]

Creates a new lexicon.

Since
3.1

Parameters

TSILexiconID & aLexiconIDreference where lexicon ID is stored

CreateModelBank(TSIModelBankID &)

TInt CreateModelBank(TSIModelBankID &aModelBankID)[pure virtual]

Creates a new model bank.

Since
3.1

Parameters

TSIModelBankID & aModelBankIDreference where a new model bank Id is assigned to

CreateRule(TSIGrammarID, TSIRuleID &)

TInt CreateRule(TSIGrammarIDaGrammarID,
TSIRuleID &aRuleID
)[pure virtual]

Creates a new rule.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar, where the new rule is to be added
TSIRuleID & aRuleIDreference where rule ID is stored

DeactivateGrammar(TSIGrammarID)

TInt DeactivateGrammar(TSIGrammarIDaGrammarID)[pure virtual]

Deactivates a loaded grammar, so that it is not recognized.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar ID

EndRecSession()

TInt EndRecSession()[pure virtual]

Ends the current recognition session. Resources allocated for recognition are freed.

Since
3.1

EndRecord()

TInt EndRecord()[pure virtual]

Stops the recording. The difference with Cancel is that if enough samples were recorded, a recognition result will be produced.

Since
3.1

GetAllClientGrammarIDs(RArray< TSIGrammarID > &)

TInt GetAllClientGrammarIDs(RArray< TSIGrammarID > &aGrammarIDs)[pure virtual]

Returns all grammar Ids that belong to the current client.

Since
3.1

Parameters

RArray< TSIGrammarID > & aGrammarIDsreference where grammar Ids are stored

GetAllClientLexiconIDs(RArray< TSILexiconID > &)

TInt GetAllClientLexiconIDs(RArray< TSILexiconID > &aLexiconIDs)[pure virtual]

Returns all lexicon Ids that belong to the current client.

Since
3.1

Parameters

RArray< TSILexiconID > & aLexiconIDsreference where lexicon Ids are stored

GetAllClientModelBankIDs(RArray< TSIModelBankID > &)

TInt GetAllClientModelBankIDs(RArray< TSIModelBankID > &aModelBankIDs)[pure virtual]

Returns all model bank Ids that belong to the current client.

Since
3.1

Parameters

RArray< TSIModelBankID > & aModelBankIDsreference where model bank Ids are stored

GetAllGrammarIDs(RArray< TSIGrammarID > &)

TInt GetAllGrammarIDs(RArray< TSIGrammarID > &aGrammarIDs)[pure virtual]

Returns all grammar Ids that exist (for all clients).

Since
3.1

Parameters

RArray< TSIGrammarID > & aGrammarIDsreference where grammar Ids are stored

GetAllLexiconIDs(RArray< TSILexiconID > &)

TInt GetAllLexiconIDs(RArray< TSILexiconID > &aLexiconIDs)[pure virtual]

Returns all lexicon Ids that exist (for all clients).

Since
3.1

Parameters

RArray< TSILexiconID > & aLexiconIDsreference where lexicon Ids are stored

GetAllModelBankIDs(RArray< TSIModelBankID > &)

TInt GetAllModelBankIDs(RArray< TSIModelBankID > &aModelBankIDs)[pure virtual]

Returns all model bank Ids that exist (for all clients).

Since
3.1

Parameters

RArray< TSIModelBankID > & aModelBankIDsreference where model bank Ids are stored

GetAllModelIDs(TSIModelBankID, RArray< TSIModelID > &)

TInt GetAllModelIDs(TSIModelBankIDaModelBankID,
RArray< TSIModelID > &aModelIDs
)[pure virtual]

Returns all model Ids that exist in the specified model bank.

Since
3.1

Parameters

TSIModelBankID aModelBankIDmodel bank Id
RArray< TSIModelID > & aModelIDsreference where model Ids are stored

GetAllPronunciationIDs(TSILexiconID, RArray< TSIPronunciationID > &)

TInt GetAllPronunciationIDs(TSILexiconIDaLexiconID,
RArray< TSIPronunciationID > &aPronunciationIDs
)[pure virtual]

Returns all pronunciation Ids that exist in the specified lexicon.

Since
3.1

Parameters

TSILexiconID aLexiconIDlexicon Id
RArray< TSIPronunciationID > & aPronunciationIDsreference where pronunciation Ids are stored

GetAllRuleIDs(TSIGrammarID, RArray< TSIRuleID > &)

TInt GetAllRuleIDs(TSIGrammarIDaGrammarID,
RArray< TSIRuleID > &aRuleIDs
)[pure virtual]

Returns all rule Ids that exist in the specified grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id
RArray< TSIRuleID > & aRuleIDsreference where rule Ids are stored

GetEngineProperties(const RArray< TInt > &, RArray< TInt > &)

TInt GetEngineProperties(const RArray< TInt > &aPropertyId,
RArray< TInt > &aPropertyValue
)[pure virtual]

Returns the engine properties specified by the engine property ID array. On return aPropertyValue contains an array of engine properties.

Since
3.1

Parameters

const RArray< TInt > & aPropertyIdconstant reference to array of engine property Ids
RArray< TInt > & aPropertyValuereference to array of engine property values

GetModelCount(TSIModelBankID, TInt &)

TInt GetModelCount(TSIModelBankIDaModelBankID,
TInt &aModelCount
)[pure virtual]

Returns the number of models in the specified model bank.

Since
3.1

Parameters

TSIModelBankID aModelBankIDmodel bank Id
TInt & aModelCount

GetRuleValidity(TSIGrammarID, TSIRuleID, TBool &)

TInt GetRuleValidity(TSIGrammarIDaGrammarID,
TSIRuleIDaRuleID,
TBool &aValid
)[pure virtual]

Checks if the rule is valid or not.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id
TSIRuleID aRuleIDrule Id
TBool & aValidreference where the validity of the rule is set

LoadEngineParameters(const RArray< TInt > &, const RArray< TInt > &)

TInt LoadEngineParameters(const RArray< TInt > &aParameterId,
const RArray< TInt > &aParameterValue
)[pure virtual]

Uploads the specified parameters into the engine.

Since
3.1

Parameters

const RArray< TInt > & aParameterIdarray of parameter IDs
const RArray< TInt > & aParameterValuearray of parameter values

LoadGrammar(TSIGrammarID)

TInt LoadGrammar(TSIGrammarIDaGrammarID)[pure virtual]

Loads the specified grammar into the recognizer. done prior to recognition.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar ID

LoadLexicon(TSILexiconID)

TInt LoadLexicon(TSILexiconIDaLexiconID)[pure virtual]

Loads the specified lexicon into the recognizer; done prior to recognition.

Since
3.1

Parameters

TSILexiconID aLexiconIDlexicon ID

LoadModels(TSIModelBankID)

TInt LoadModels(TSIModelBankIDaModelBankID)[pure virtual]

Loads the specified model bank into the recognizer. done prior to recognition.

Since
3.1

Parameters

TSIModelBankID aModelBankID

PreStartSampling()

TInt PreStartSampling()[pure virtual]

Pre-starts samping before Record call.

Since
3.2

Recognize(CSIClientResultSet &)

TInt Recognize(CSIClientResultSet &aResultSet)[pure virtual]

Initiates speaker independent recognition; performed following loading of model bank, lexicon, and grammar.

Since
3.1

Parameters

CSIClientResultSet & aResultSetreference where the recognition result is set

Record(TTimeIntervalMicroSeconds32)

TInt Record(TTimeIntervalMicroSeconds32aRecordTime)[pure virtual]

Records utterance for recognition.

Since
3.1

Parameters

TTimeIntervalMicroSeconds32 aRecordTimerecording time in microseconds

RemoveGrammar(TSIGrammarID)

TInt RemoveGrammar(TSIGrammarIDaGrammarID)[pure virtual]

Removes the specified grammar from the permanent storage. Removing a grammar will remove all rules within the grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id

RemoveLexicon(TSILexiconID)

TInt RemoveLexicon(TSILexiconIDaLexiconID)[pure virtual]

Removes the specified lexicon from the permanent storage. Removing a lexicon will remove all pronunciations within the lexicon.

Since
3.1

Parameters

TSILexiconID aLexiconIDlexicon Id

RemoveModel(TSIModelBankID, TSIModelID)

TInt RemoveModel(TSIModelBankIDaModelBankID,
TSIModelIDaModelID
)[pure virtual]

Removes the specified model from the specified model bank permanently.

Since
3.1

Parameters

TSIModelBankID aModelBankIDmodel bank Id
TSIModelID aModelIDmodel Id

RemoveModelBank(TSIModelBankID)

TInt RemoveModelBank(TSIModelBankIDaModelBankID)[pure virtual]

Removes the specified model bank from the permanent storage. Removing a model bank will remove all models within the model bank.

Since
3.1

Parameters

TSIModelBankID aModelBankIDmodel bank Id

RemovePronunciation(TSILexiconID, TSIPronunciationID)

TInt RemovePronunciation(TSILexiconIDaLexiconID,
TSIPronunciationIDaPronunciationID
)[pure virtual]

Removes the specified pronunciation from the specified lexicon permanently.

Since
3.1

Parameters

TSILexiconID aLexiconIDlexicon Id
TSIPronunciationID aPronunciationIDpronunciation Id

RemoveRule(TSIGrammarID, TSIRuleID)

TInt RemoveRule(TSIGrammarIDaGrammarID,
TSIRuleIDaRuleID
)[pure virtual]

Removes the specified rule from the specified grammar permanently.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id
TSIRuleID aRuleIDrule Id

RemoveRules(TSIGrammarID, RArray< TSIRuleID > &)

TInt RemoveRules(TSIGrammarIDaGrammarID,
RArray< TSIRuleID > &aRuleIDs
)[pure virtual]

Removes multiple rules from the specified grammar permanently.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id
RArray< TSIRuleID > & aRuleIDs

SetAudioPriority(TInt, TInt, TInt, TInt)

TInt SetAudioPriority(TIntaPriority,
TIntaTrainPreference,
TIntaPlaybackPreference,
TIntaRecognitionPreference
)[pure virtual]

Set the audio priority and preference recognition

Since
3.1

Parameters

TInt aPrioritypriority for voice recognition
TInt aTrainPreferencepreference for training
TInt aPlaybackPreferencepreference for playback
TInt aRecognitionPreferencepreference for recognition

SetEventHandler(MSISpeechRecognitionUtilityObserver *)

voidSetEventHandler(MSISpeechRecognitionUtilityObserver *aSpeechRecognitionUtilityObserver)[pure virtual]

Set the event handler for asynchronous events

Since
3.1

Parameters

MSISpeechRecognitionUtilityObserver * aSpeechRecognitionUtilityObserverpointer to observer

StartRecSession(TNSSRecognitionMode)

TInt StartRecSession(TNSSRecognitionModeaMode)[pure virtual]

Starts a new recognition session.

Since
3.1

Parameters

TNSSRecognitionMode aModerecognition mode

UnloadGrammar(TSIGrammarID)

TInt UnloadGrammar(TSIGrammarIDaGrammarID)[pure virtual]

Unloads the specified grammar from the list of grammars in temporary memory, previously loaded with LoadGrammarL. The grammar in the permanent storage remains intact.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id

UnloadRule(TSIGrammarID, TSIRuleID)

TInt UnloadRule(TSIGrammarIDaGrammarID,
TSIRuleIDaRuleID
)[pure virtual]

Unloads the specified rule from the specified grammar in temporary memory, previously loaded with LoadGrammarL. The rule in the permanent storage remains intact.

Since
3.1

Parameters

TSIGrammarID aGrammarIDgrammar Id
TSIRuleID aRuleIDrule Id