RSpeechRecognitionCustomCommands Class Reference

class RSpeechRecognitionCustomCommands : public RMMFCustomCommandsBase

This is the main class of Speech Recognition Custom Commands.

Since
8.0

Inherits from

Public Member Functions
RSpeechRecognitionCustomCommands ( RMMFController &)
IMPORT_C TInt AddPronunciation ( TLexiconID , TModelBankID , TModelID , TPronunciationID &)
IMPORT_C TInt AddRule ( TGrammarID , TLexiconID , TPronunciationID , TRuleID &)
IMPORT_C void Cancel ()
IMPORT_C TInt CommitChanges ()
IMPORT_C TInt CreateGrammar ( TGrammarID &)
IMPORT_C TInt CreateLexicon ( TLexiconID &)
IMPORT_C TInt CreateModelBank ( TModelBankID &)
IMPORT_C TInt EndRecSession ()
IMPORT_C TInt GetAllClientGrammarIDs ()
IMPORT_C TInt GetAllClientLexiconIDs ()
IMPORT_C TInt GetAllClientModelBankIDs ()
IMPORT_C TInt GetAllGrammarIDs ()
IMPORT_C TInt GetAllLexiconIDs ()
IMPORT_C TInt GetAllModelBankIDs ()
IMPORT_C TInt GetAllModelIDs ( TModelBankID )
IMPORT_C TInt GetAllPronunciationIDs ( TLexiconID )
IMPORT_C TInt GetAllRuleIDs ( TGrammarID )
IMPORT_C TInt GetAvailableStorage ( TInt &)
IMPORT_C TInt GetEngineProperties (const RArray < TInt > &, RArray < TInt > &)
IMPORT_C void GetGrammarIDArrayL ( RArray < TGrammarID > &)
IMPORT_C void GetLexiconIDArrayL ( RArray < TLexiconID > &)
IMPORT_C void GetModelBankIDArrayL ( RArray < TModelBankID > &)
IMPORT_C TInt GetModelCount ( TModelBankID , TInt &)
IMPORT_C void GetModelIDArrayL ( RArray < TModelID > &)
IMPORT_C void GetPronunciationIDArrayL ( RArray < TPronunciationID > &)
IMPORT_C void GetResultSetL ( CSDClientResultSet &)
IMPORT_C void GetRuleIDArrayL ( RArray < TRuleID > &)
IMPORT_C TInt GetRuleValidity ( TGrammarID , TRuleID , TBool &)
IMPORT_C TInt GetUtteranceDuration ( TModelBankID , TModelID , TTimeIntervalMicroSeconds32 &)
IMPORT_C TInt LoadEngineParameters (const RArray < TInt > &, const RArray < TInt > &)
IMPORT_C TInt LoadGrammar ( TGrammarID )
IMPORT_C TInt LoadLexicon ( TLexiconID )
IMPORT_C TInt LoadModels ( TModelBankID )
IMPORT_C TInt PlayUtterance ( TModelBankID , TModelID )
IMPORT_C TInt Recognize ( CSDClientResultSet &)
IMPORT_C TInt Record ( TTimeIntervalMicroSeconds32 )
IMPORT_C TInt RemoveGrammar ( TGrammarID )
IMPORT_C TInt RemoveLexicon ( TLexiconID )
IMPORT_C TInt RemoveModel ( TModelBankID , TModelID )
IMPORT_C TInt RemoveModelBank ( TModelBankID )
IMPORT_C TInt RemovePronunciation ( TLexiconID , TPronunciationID )
IMPORT_C TInt RemoveRule ( TGrammarID , TRuleID )
IMPORT_C TInt SetClientUid ( TUid )
IMPORT_C TInt StartRecSession ( TRecognitionMode )
IMPORT_C TInt Train ( TModelBankID , TModelID &)
IMPORT_C TInt UnloadRule ( TGrammarID , TRuleID )
Private Member Functions
void DoGetEnginePropertiesL (const RArray < TInt > &, RArray < TInt > &)
void DoLoadEngineParametersL (const RArray < TInt > &, const RArray < TInt > &)
void DoRecognizeL ( CSDClientResultSet &)
CBufFlat * ExternalizeIntArrayL (const RArray < TInt > &)
void InternalizeIntArrayL ( TDes8 &, TInt , RArray < TInt > &)
Inherited Functions
RMMFCustomCommandsBase::RMMFCustomCommandsBase(RMMFController &,TUid)
Private Attributes
TAny * iReservedPtr_1
TAny * iReservedPtr_2
Inherited Attributes
RMMFCustomCommandsBase::iController
RMMFCustomCommandsBase::iDestinationPckg

Constructor & Destructor Documentation

RSpeechRecognitionCustomCommands(RMMFController &)

IMPORT_C RSpeechRecognitionCustomCommands ( RMMFController & aController )

Public C++ constructor for RSpeechRecognitionCustomCommands class.

Since
8.0

Parameters

RMMFController & aController A reference to a RMMFController object.

Member Functions Documentation

AddPronunciation(TLexiconID, TModelBankID, TModelID, TPronunciationID &)

IMPORT_C TInt AddPronunciation ( TLexiconID aLexiconID,
TModelBankID aModelBankID,
TModelID aModelID,
TPronunciationID & aPronunciationID
)

Adds a new pronunciation for the given model into the specified lexicon.

Since
8.0

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.

AddRule(TGrammarID, TLexiconID, TPronunciationID, TRuleID &)

IMPORT_C TInt AddRule ( TGrammarID aGrammarID,
TLexiconID aLexiconID,
TPronunciationID aPronunciationID,
TRuleID & aRuleID
)

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

Since
8.0

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.

Cancel()

IMPORT_C void Cancel ( )

Cancels the current operation.

Since
8.0

CommitChanges()

IMPORT_C TInt CommitChanges ( )

Commits the current train operation to the database.

Since
8.0

CreateGrammar(TGrammarID &)

IMPORT_C TInt CreateGrammar ( TGrammarID & aGrammarID )

Creates a new grammar.

Since
8.0

Parameters

TGrammarID & aGrammarID A reference to where the grammar ID is stored.

CreateLexicon(TLexiconID &)

IMPORT_C TInt CreateLexicon ( TLexiconID & aLexiconID )

Creates a new lexicon.

Since
8.0

Parameters

TLexiconID & aLexiconID A reference where lexicon ID is stored.

CreateModelBank(TModelBankID &)

IMPORT_C TInt CreateModelBank ( TModelBankID & aModelBankID )

Creates a new model bank.

Since
8.0

Parameters

TModelBankID & aModelBankID A reference to where a new model bank ID is assigned.

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

void DoGetEnginePropertiesL ( const RArray < TInt > & aPropertyId,
RArray < TInt > & aPropertyValue
) [private]

Parameters

const RArray < TInt > & aPropertyId
RArray < TInt > & aPropertyValue

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

void DoLoadEngineParametersL ( const RArray < TInt > & aParameterId,
const RArray < TInt > & aParameterValue
) [private]

Parameters

const RArray < TInt > & aParameterId
const RArray < TInt > & aParameterValue

DoRecognizeL(CSDClientResultSet &)

void DoRecognizeL ( CSDClientResultSet & aResultSet ) [private]

Parameters

CSDClientResultSet & aResultSet

EndRecSession()

IMPORT_C TInt EndRecSession ( )

Ends the current recognition session.

The resources allocated for recognition are freed.

Since
8.0

ExternalizeIntArrayL(const RArray< TInt > &)

CBufFlat * ExternalizeIntArrayL ( const RArray < TInt > & aArray ) [private]

Parameters

const RArray < TInt > & aArray

GetAllClientGrammarIDs()

IMPORT_C TInt GetAllClientGrammarIDs ( )

Returns all grammar IDs owned by the client.

Since
8.0

GetAllClientLexiconIDs()

IMPORT_C TInt GetAllClientLexiconIDs ( )

Returns all lexicon IDs owned by the client.

Since
8.0

GetAllClientModelBankIDs()

IMPORT_C TInt GetAllClientModelBankIDs ( )

Returns all modelBank IDs owned by the client.

Since
8.0

GetAllGrammarIDs()

IMPORT_C TInt GetAllGrammarIDs ( )

Returns all grammar IDs owned by the client.

Since
8.0

GetAllLexiconIDs()

IMPORT_C TInt GetAllLexiconIDs ( )

Returns all lexicon IDs owned by the client.

Since
8.0

GetAllModelBankIDs()

IMPORT_C TInt GetAllModelBankIDs ( )

Returns all modelBank IDs owned by the client.

Since
8.0

GetAllModelIDs(TModelBankID)

IMPORT_C TInt GetAllModelIDs ( TModelBankID aModelBankID )

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

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.

GetAllPronunciationIDs(TLexiconID)

IMPORT_C TInt GetAllPronunciationIDs ( TLexiconID aLexiconID )

Returns all pronunciation IDs that exist in the specified lexicon.

Since
8.0

Parameters

TLexiconID aLexiconID The lexicon ID.

GetAllRuleIDs(TGrammarID)

IMPORT_C TInt GetAllRuleIDs ( TGrammarID aGrammarID )

Returns all rule IDs that exist in the specified grammar.

Since
8.0

Parameters

TGrammarID aGrammarID The grammar ID.

GetAvailableStorage(TInt &)

IMPORT_C TInt GetAvailableStorage ( TInt & aAvailableStorage )

Returns the number of models available for training system wide, based on available disk space.

Since
8.0

Parameters

TInt & aAvailableStorage The number of models that can be held in available storage space.

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

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.

Since
8.0

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.

GetGrammarIDArrayL(RArray< TGrammarID > &)

IMPORT_C void GetGrammarIDArrayL ( RArray < TGrammarID > & aGrammarIDs )

Gets an array of grammar IDs previously requested by GetAllGrammarIDs.

Since
8.0

Parameters

RArray < TGrammarID > & aGrammarIDs An array to store grammar IDs.

GetLexiconIDArrayL(RArray< TLexiconID > &)

IMPORT_C void GetLexiconIDArrayL ( RArray < TLexiconID > & aLexiconIDs )

Gets an array of lexicon IDs previously requested by GetAllLexiconIDs.

Since
8.0

Parameters

RArray < TLexiconID > & aLexiconIDs An array to store lexicon IDs.

GetModelBankIDArrayL(RArray< TModelBankID > &)

IMPORT_C void GetModelBankIDArrayL ( RArray < TModelBankID > & aModelBankIDs )

Gets an array of modelBank IDs previously requested by GetAllModelBankIDs.

Since
8.0

Parameters

RArray < TModelBankID > & aModelBankIDs An array to store modelBank IDs.

GetModelCount(TModelBankID, TInt &)

IMPORT_C TInt GetModelCount ( TModelBankID aModelBankID,
TInt & aModelCount
)

Returns the number of models in the specified model bank.

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.
TInt & aModelCount The reference where the number of models is set.

GetModelIDArrayL(RArray< TModelID > &)

IMPORT_C void GetModelIDArrayL ( RArray < TModelID > & aModelIDs )

Gets an array of model IDs previously requested by GetAllModelIDs.

Since
8.0

Parameters

RArray < TModelID > & aModelIDs An array to store model IDs.

GetPronunciationIDArrayL(RArray< TPronunciationID > &)

IMPORT_C void GetPronunciationIDArrayL ( RArray < TPronunciationID > & aPronunciationIDs )

Gets an array of pronunciation IDs previously requested by GetAllPronunciationIDs.

Since
8.0

Parameters

RArray < TPronunciationID > & aPronunciationIDs An array to store pronunciation IDs.

GetResultSetL(CSDClientResultSet &)

IMPORT_C void GetResultSetL ( CSDClientResultSet & aResultSet )

Gets a client result set previously created by a call to Recognise().

Since
8.0

Parameters

CSDClientResultSet & aResultSet The ResultSet used to contain the recognition results

GetRuleIDArrayL(RArray< TRuleID > &)

IMPORT_C void GetRuleIDArrayL ( RArray < TRuleID > & aRuleIDs )

Gets an array of rule IDs previously requested by GetAllRuleIDs.

Since
8.0

Parameters

RArray < TRuleID > & aRuleIDs An array to store rule IDs.

GetRuleValidity(TGrammarID, TRuleID, TBool &)

IMPORT_C TInt GetRuleValidity ( TGrammarID aGrammarID,
TRuleID aRuleID,
TBool & aValid
)

Checks if the rule is valid or not.

Since
8.0

Parameters

TGrammarID aGrammarID The grammar ID.
TRuleID aRuleID The rule ID.
TBool & aValid A reference where the validity of the rule is set.

GetUtteranceDuration(TModelBankID, TModelID, TTimeIntervalMicroSeconds32 &)

IMPORT_C TInt GetUtteranceDuration ( TModelBankID aModelBankID,
TModelID aModelID,
TTimeIntervalMicroSeconds32 & aDuration
)
Returns the duration of the utterance for the specified model.
Since
8.0

Parameters

TModelBankID aModelBankID model bank Id
TModelID aModelID model Id
TTimeIntervalMicroSeconds32 & aDuration reference where the duration of utterance is set

InternalizeIntArrayL(TDes8 &, TInt, RArray< TInt > &)

void InternalizeIntArrayL ( TDes8 & aDes,
TInt aNumberElements,
RArray < TInt > & aArray
) [private]

Parameters

TDes8 & aDes
TInt aNumberElements
RArray < TInt > & aArray

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

IMPORT_C TInt LoadEngineParameters ( const RArray < TInt > & aParameterId,
const RArray < TInt > & aParameterValue
)

Uploads the specified parameters into the engine.

Since
8.0

Parameters

const RArray < TInt > & aParameterId An array of parameter IDs.
const RArray < TInt > & aParameterValue An array of parameter values.

LoadGrammar(TGrammarID)

IMPORT_C TInt LoadGrammar ( TGrammarID aGrammarID )

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

Since
8.0

Parameters

TGrammarID aGrammarID The grammar ID.

LoadLexicon(TLexiconID)

IMPORT_C TInt LoadLexicon ( TLexiconID aLexiconID )

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

Since
8.0

Parameters

TLexiconID aLexiconID The lexicon ID.

LoadModels(TModelBankID)

IMPORT_C TInt LoadModels ( TModelBankID aModelBankID )

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

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.

PlayUtterance(TModelBankID, TModelID)

IMPORT_C TInt PlayUtterance ( TModelBankID aModelBankID,
TModelID aModelID
)

Plays the previously trained utterance.

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.
TModelID aModelID The model ID, whose utterance is played.

Recognize(CSDClientResultSet &)

IMPORT_C TInt Recognize ( CSDClientResultSet & aResultSet )

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

Since
8.0

Parameters

CSDClientResultSet & aResultSet A reference where the recognition result is set.

Record(TTimeIntervalMicroSeconds32)

IMPORT_C TInt Record ( TTimeIntervalMicroSeconds32 aRecordTime )

Records the user utterance for training and recognition.

Since
8.0

Parameters

TTimeIntervalMicroSeconds32 aRecordTime The recording time in microseconds.

RemoveGrammar(TGrammarID)

IMPORT_C TInt RemoveGrammar ( TGrammarID aGrammarID )

Removes the specified grammar from the permanent storage.

Removing a grammar will remove all rules within the grammar.

Since
8.0

Parameters

TGrammarID aGrammarID The grammar ID.

RemoveLexicon(TLexiconID)

IMPORT_C TInt RemoveLexicon ( TLexiconID aLexiconID )

Removes the specified lexicon from the permanent storage.

Removing a lexicon will remove all pronunciations within the lexicon.

Since
8.0

Parameters

TLexiconID aLexiconID The lexicon ID.

RemoveModel(TModelBankID, TModelID)

IMPORT_C TInt RemoveModel ( TModelBankID aModelBankID,
TModelID aModelID
)

Removes the specified model from the specified model bank permanently.

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.
TModelID aModelID The model ID.

RemoveModelBank(TModelBankID)

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.

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.

RemovePronunciation(TLexiconID, TPronunciationID)

IMPORT_C TInt RemovePronunciation ( TLexiconID aLexiconID,
TPronunciationID aPronunciationID
)

Removes the specified pronunciation from the specified lexicon permanently.

Since
8.0

Parameters

TLexiconID aLexiconID The lexicon ID.
TPronunciationID aPronunciationID The pronunciation ID.

RemoveRule(TGrammarID, TRuleID)

IMPORT_C TInt RemoveRule ( TGrammarID aGrammarID,
TRuleID aRuleID
)

Removes the specified rule from the specified grammar permanently.

Since
8.0

Parameters

TGrammarID aGrammarID The grammar ID.
TRuleID aRuleID The rule ID.

SetClientUid(TUid)

IMPORT_C TInt SetClientUid ( TUid aClientUid )

Sets the client UID for client.

Since
8.0

Parameters

TUid aClientUid The client UID.

StartRecSession(TRecognitionMode)

IMPORT_C TInt StartRecSession ( TRecognitionMode aMode )

Starts a new recognition session.

Since
8.0

Parameters

TRecognitionMode aMode The recognition mode.

Train(TModelBankID, TModelID &)

IMPORT_C TInt Train ( TModelBankID aModelBankID,
TModelID & aModelID
)

Trains a new model into the specified model bank.

Since
8.0

Parameters

TModelBankID aModelBankID The model bank ID.
TModelID & aModelID The reference to where a new model ID is assigned.

UnloadRule(TGrammarID, TRuleID)

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.

Since
8.0

Parameters

TGrammarID aGrammarID The grammar ID.
TRuleID aRuleID The rule ID.

Member Data Documentation

TAny * iReservedPtr_1

TAny * iReservedPtr_1 [private]

TAny * iReservedPtr_2

TAny * iReservedPtr_2 [private]