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 > &)
void Cancel ()
TInt CommitChanges ()
TInt CreateGrammar ( TSIGrammarID &)
void CreateInstanceSecondPhaseL ( 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 )
void SetEventHandler ( 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 ( TSIGrammarID aGrammarID ) [pure virtual]

Reactivates a previously deactivated grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar ID

Adapt(const CSIClientResultSet &, TInt)

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

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

Since
3.1

Parameters

const CSIClientResultSet & aResultSet Recognition result N-Best
TInt aCorrect Index to N-Best pointing the correct result.

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

TInt AddPronunciation ( TSILexiconID aLexiconID,
const TDesC & aTextForTraining,
TLanguage aLanguage,
TSIPronunciationID & aPronunciationID
) [pure virtual]

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

Since
3.1

Parameters

TSILexiconID aLexiconID lexicon Id, where the new pronunciation is added to
const TDesC & aTextForTraining Text to be trained
TLanguage aLanguage Pronunciation language
TSIPronunciationID & aPronunciationID reference where a new pronunciation Id is assigned to

AddRule(TSIGrammarID, TSILexiconID, TSIPronunciationID, TSIRuleID &)

TInt AddRule ( TSIGrammarID aGrammarID,
TSILexiconID aLexiconID,
TSIPronunciationID aPronunciationID,
TSIRuleID & aRuleID
) [pure virtual]

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

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar Id, where the new rule is added to
TSILexiconID aLexiconID lexicon Id
TSIPronunciationID aPronunciationID pronunciation Id
TSIRuleID & aRuleID reference where a new rule Id is assigned to

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

TInt AddRuleVariant ( TSIGrammarID aGrammarID,
TSILexiconID aLexiconID,
RArray < TSIPronunciationID > & aPronunciationIDs,
TSIRuleID aRuleID,
TSIRuleVariantID & aRuleVariantID
) [pure virtual]

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

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar Id, where the new rule is added to
TSILexiconID aLexiconID
RArray < TSIPronunciationID > & aPronunciationIDs the phrase is the concatenation of these pronunciation IDs
TSIRuleID aRuleID the rule Id, which will contain this variant
TSIRuleVariantID & aRuleVariantID reference 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,
TSILexiconID aLexiconID,
TSIGrammarID aGrammarID,
TSIRuleID & aRuleID
) [pure virtual]

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

Since
3.1

Parameters

MDesCArray & aTextArray the text to be trained, divided in to words. The phrase is the concatenation of these words.
const RArray < TLanguage > & aLanguageArray pronunciations will be generated for these languages
TSILexiconID aLexiconID lexicon, where to add pronunciations
TSIGrammarID aGrammarID grammar, where to add rules
TSIRuleID & aRuleID the 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,
TSILexiconID aLexiconID,
TSIGrammarID aGrammarID,
TSIRuleID & aRuleID
) [pure virtual]

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

Since
3.1

Parameters

MDesCArray & aTextArray The text to be trained, divided in to words. The phrase is the concatenation of these words.
const RArray < RLanguageArray > & aLanguageArray Pronunciations will be generated for these languages
TSILexiconID aLexiconID Lexicon, where to add pronunciations
TSIGrammarID aGrammarID Grammar, where to add rules
TSIRuleID & aRuleID The 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,
TSILexiconID aLexiconID,
TSIGrammarID aGrammarID,
RArray < TSIRuleID > & aRuleIDArray
) [pure virtual]

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

Since
3.1

Parameters

const RPointerArray < MDesCArray > & aTextArrayArray Array of text arrays. The phrase k is the concatenation of texts in array k.
const RArray < TLanguage > & aLanguageArray pronunciations will be generated for these languages
TSILexiconID aLexiconID lexicon, where to add pronunciations
TSIGrammarID aGrammarID grammar, 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,
TSILexiconID aLexiconID,
TSIGrammarID aGrammarID,
RArray < TSIRuleID > & aRuleIDArray
) [pure virtual]

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

Since
3.1

Parameters

const RPointerArray < MDesCArray > & aTextArrayArray Array of text arrays. The phrase k is the concatenation of texts in array k.
const RArray < RLanguageArray > & aLanguageArray pronunciations will be generated for these languages
TSILexiconID aLexiconID lexicon, where to add pronunciations
TSIGrammarID aGrammarID grammar, where to add rules
RArray < TSIRuleID > & aRuleIDArray

Cancel()

void Cancel ( ) [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 & aGrammarID reference where grammar ID is stored

CreateInstanceSecondPhaseL(TUid, TUid, MSISpeechRecognitionUtilityObserver &)

void CreateInstanceSecondPhaseL ( TUid aClientUid,
TUid aPluginUid,
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 aClientUid Client UID for data ownership, other clients won't be able to modify the data registered to certain client
TUid aPluginUid UID of the plugin which will be used, KNullUid to search for suitable plugin
MSISpeechRecognitionUtilityObserver & aObserver Callback observer reference

CreateLexicon(TSILexiconID &)

TInt CreateLexicon ( TSILexiconID & aLexiconID ) [pure virtual]

Creates a new lexicon.

Since
3.1

Parameters

TSILexiconID & aLexiconID reference where lexicon ID is stored

CreateModelBank(TSIModelBankID &)

TInt CreateModelBank ( TSIModelBankID & aModelBankID ) [pure virtual]

Creates a new model bank.

Since
3.1

Parameters

TSIModelBankID & aModelBankID reference where a new model bank Id is assigned to

CreateRule(TSIGrammarID, TSIRuleID &)

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

Creates a new rule.

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar, where the new rule is to be added
TSIRuleID & aRuleID reference where rule ID is stored

DeactivateGrammar(TSIGrammarID)

TInt DeactivateGrammar ( TSIGrammarID aGrammarID ) [pure virtual]

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

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar 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 > & aGrammarIDs reference 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 > & aLexiconIDs reference 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 > & aModelBankIDs reference 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 > & aGrammarIDs reference 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 > & aLexiconIDs reference 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 > & aModelBankIDs reference where model bank Ids are stored

GetAllModelIDs(TSIModelBankID, RArray< TSIModelID > &)

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

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

Since
3.1

Parameters

TSIModelBankID aModelBankID model bank Id
RArray < TSIModelID > & aModelIDs reference where model Ids are stored

GetAllPronunciationIDs(TSILexiconID, RArray< TSIPronunciationID > &)

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

Returns all pronunciation Ids that exist in the specified lexicon.

Since
3.1

Parameters

TSILexiconID aLexiconID lexicon Id
RArray < TSIPronunciationID > & aPronunciationIDs reference where pronunciation Ids are stored

GetAllRuleIDs(TSIGrammarID, RArray< TSIRuleID > &)

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

Returns all rule Ids that exist in the specified grammar.

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar Id
RArray < TSIRuleID > & aRuleIDs reference 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 > & aPropertyId constant reference to array of engine property Ids
RArray < TInt > & aPropertyValue reference to array of engine property values

GetModelCount(TSIModelBankID, TInt &)

TInt GetModelCount ( TSIModelBankID aModelBankID,
TInt & aModelCount
) [pure virtual]

Returns the number of models in the specified model bank.

Since
3.1

Parameters

TSIModelBankID aModelBankID model bank Id
TInt & aModelCount

GetRuleValidity(TSIGrammarID, TSIRuleID, TBool &)

TInt GetRuleValidity ( TSIGrammarID aGrammarID,
TSIRuleID aRuleID,
TBool & aValid
) [pure virtual]

Checks if the rule is valid or not.

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar Id
TSIRuleID aRuleID rule Id
TBool & aValid reference 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 > & aParameterId array of parameter IDs
const RArray < TInt > & aParameterValue array of parameter values

LoadGrammar(TSIGrammarID)

TInt LoadGrammar ( TSIGrammarID aGrammarID ) [pure virtual]

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

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar ID

LoadLexicon(TSILexiconID)

TInt LoadLexicon ( TSILexiconID aLexiconID ) [pure virtual]

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

Since
3.1

Parameters

TSILexiconID aLexiconID lexicon ID

LoadModels(TSIModelBankID)

TInt LoadModels ( TSIModelBankID aModelBankID ) [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 & aResultSet reference where the recognition result is set

Record(TTimeIntervalMicroSeconds32)

TInt Record ( TTimeIntervalMicroSeconds32 aRecordTime ) [pure virtual]

Records utterance for recognition.

Since
3.1

Parameters

TTimeIntervalMicroSeconds32 aRecordTime recording time in microseconds

RemoveGrammar(TSIGrammarID)

TInt RemoveGrammar ( TSIGrammarID aGrammarID ) [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 aGrammarID grammar Id

RemoveLexicon(TSILexiconID)

TInt RemoveLexicon ( TSILexiconID aLexiconID ) [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 aLexiconID lexicon Id

RemoveModel(TSIModelBankID, TSIModelID)

TInt RemoveModel ( TSIModelBankID aModelBankID,
TSIModelID aModelID
) [pure virtual]

Removes the specified model from the specified model bank permanently.

Since
3.1

Parameters

TSIModelBankID aModelBankID model bank Id
TSIModelID aModelID model Id

RemoveModelBank(TSIModelBankID)

TInt RemoveModelBank ( TSIModelBankID aModelBankID ) [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 aModelBankID model bank Id

RemovePronunciation(TSILexiconID, TSIPronunciationID)

TInt RemovePronunciation ( TSILexiconID aLexiconID,
TSIPronunciationID aPronunciationID
) [pure virtual]

Removes the specified pronunciation from the specified lexicon permanently.

Since
3.1

Parameters

TSILexiconID aLexiconID lexicon Id
TSIPronunciationID aPronunciationID pronunciation Id

RemoveRule(TSIGrammarID, TSIRuleID)

TInt RemoveRule ( TSIGrammarID aGrammarID,
TSIRuleID aRuleID
) [pure virtual]

Removes the specified rule from the specified grammar permanently.

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar Id
TSIRuleID aRuleID rule Id

RemoveRules(TSIGrammarID, RArray< TSIRuleID > &)

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

Removes multiple rules from the specified grammar permanently.

Since
3.1

Parameters

TSIGrammarID aGrammarID grammar Id
RArray < TSIRuleID > & aRuleIDs

SetAudioPriority(TInt, TInt, TInt, TInt)

TInt SetAudioPriority ( TInt aPriority,
TInt aTrainPreference,
TInt aPlaybackPreference,
TInt aRecognitionPreference
) [pure virtual]

Set the audio priority and preference recognition

Since
3.1

Parameters

TInt aPriority priority for voice recognition
TInt aTrainPreference preference for training
TInt aPlaybackPreference preference for playback
TInt aRecognitionPreference preference for recognition

SetEventHandler(MSISpeechRecognitionUtilityObserver *)

void SetEventHandler ( MSISpeechRecognitionUtilityObserver * aSpeechRecognitionUtilityObserver ) [pure virtual]

Set the event handler for asynchronous events

Since
3.1

Parameters

MSISpeechRecognitionUtilityObserver * aSpeechRecognitionUtilityObserver pointer to observer

StartRecSession(TNSSRecognitionMode)

TInt StartRecSession ( TNSSRecognitionMode aMode ) [pure virtual]

Starts a new recognition session.

Since
3.1

Parameters

TNSSRecognitionMode aMode recognition mode

UnloadGrammar(TSIGrammarID)

TInt UnloadGrammar ( TSIGrammarID aGrammarID ) [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 aGrammarID grammar Id

UnloadRule(TSIGrammarID, TSIRuleID)

TInt UnloadRule ( TSIGrammarID aGrammarID,
TSIRuleID aRuleID
) [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 aGrammarID grammar Id
TSIRuleID aRuleID rule Id