RSpeechRecognitionCustomCommands Class Reference

class RSpeechRecognitionCustomCommands : public RMMFCustomCommandsBase

This is the main class of Speech Recognition Custom Commands.

8.0

Inherits from

Public Member Functions
RSpeechRecognitionCustomCommands(RMMFController &)
IMPORT_C TIntAddPronunciation(TLexiconID, TModelBankID, TModelID, TPronunciationID &)
IMPORT_C TIntAddRule(TGrammarID, TLexiconID, TPronunciationID, TRuleID &)
IMPORT_C voidCancel()
IMPORT_C TIntCommitChanges()
IMPORT_C TIntCreateGrammar(TGrammarID &)
IMPORT_C TIntCreateLexicon(TLexiconID &)
IMPORT_C TIntCreateModelBank(TModelBankID &)
IMPORT_C TIntEndRecSession()
IMPORT_C TIntGetAllClientGrammarIDs()
IMPORT_C TIntGetAllClientLexiconIDs()
IMPORT_C TIntGetAllClientModelBankIDs()
IMPORT_C TIntGetAllGrammarIDs()
IMPORT_C TIntGetAllLexiconIDs()
IMPORT_C TIntGetAllModelBankIDs()
IMPORT_C TIntGetAllModelIDs(TModelBankID)
IMPORT_C TIntGetAllPronunciationIDs(TLexiconID)
IMPORT_C TIntGetAllRuleIDs(TGrammarID)
IMPORT_C TIntGetAvailableStorage(TInt &)
IMPORT_C TIntGetEngineProperties(const RArray< TInt > &, RArray< TInt > &)
IMPORT_C voidGetGrammarIDArrayL(RArray< TGrammarID > &)
IMPORT_C voidGetLexiconIDArrayL(RArray< TLexiconID > &)
IMPORT_C voidGetModelBankIDArrayL(RArray< TModelBankID > &)
IMPORT_C TIntGetModelCount(TModelBankID, TInt &)
IMPORT_C voidGetModelIDArrayL(RArray< TModelID > &)
IMPORT_C voidGetPronunciationIDArrayL(RArray< TPronunciationID > &)
IMPORT_C voidGetResultSetL(CSDClientResultSet &)
IMPORT_C voidGetRuleIDArrayL(RArray< TRuleID > &)
IMPORT_C TIntGetRuleValidity(TGrammarID, TRuleID, TBool &)
IMPORT_C TIntGetUtteranceDuration(TModelBankID, TModelID, TTimeIntervalMicroSeconds32 &)
IMPORT_C TIntLoadEngineParameters(const RArray< TInt > &, const RArray< TInt > &)
IMPORT_C TIntLoadGrammar(TGrammarID)
IMPORT_C TIntLoadLexicon(TLexiconID)
IMPORT_C TIntLoadModels(TModelBankID)
IMPORT_C TIntPlayUtterance(TModelBankID, TModelID)
IMPORT_C TIntRecognize(CSDClientResultSet &)
IMPORT_C TIntRecord(TTimeIntervalMicroSeconds32)
IMPORT_C TIntRemoveGrammar(TGrammarID)
IMPORT_C TIntRemoveLexicon(TLexiconID)
IMPORT_C TIntRemoveModel(TModelBankID, TModelID)
IMPORT_C TIntRemoveModelBank(TModelBankID)
IMPORT_C TIntRemovePronunciation(TLexiconID, TPronunciationID)
IMPORT_C TIntRemoveRule(TGrammarID, TRuleID)
IMPORT_C TIntSetClientUid(TUid)
IMPORT_C TIntStartRecSession(TRecognitionMode)
IMPORT_C TIntTrain(TModelBankID, TModelID &)
IMPORT_C TIntUnloadRule(TGrammarID, TRuleID)
Private Member Functions
voidDoGetEnginePropertiesL(const RArray< TInt > &, RArray< TInt > &)
voidDoLoadEngineParametersL(const RArray< TInt > &, const RArray< TInt > &)
voidDoRecognizeL(CSDClientResultSet &)
CBufFlat *ExternalizeIntArrayL(const RArray< TInt > &)
voidInternalizeIntArrayL(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_CRSpeechRecognitionCustomCommands(RMMFController &aController)

Public C++ constructor for RSpeechRecognitionCustomCommands class.

8.0

Parameters

RMMFController & aControllerA reference to a RMMFController object.

Member Functions Documentation

AddPronunciation(TLexiconID, TModelBankID, TModelID, TPronunciationID &)

IMPORT_C TIntAddPronunciation(TLexiconIDaLexiconID,
TModelBankIDaModelBankID,
TModelIDaModelID,
TPronunciationID &aPronunciationID
)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TLexiconID aLexiconIDThe lexicon ID to where the new pronunciation is added.
TModelBankID aModelBankIDThe model bank ID.
TModelID aModelIDThe model ID.
TPronunciationID & aPronunciationIDA reference to where a new pronunciation ID is assigned.

AddRule(TGrammarID, TLexiconID, TPronunciationID, TRuleID &)

IMPORT_C TIntAddRule(TGrammarIDaGrammarID,
TLexiconIDaLexiconID,
TPronunciationIDaPronunciationID,
TRuleID &aRuleID
)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID to where the new rule is added.
TLexiconID aLexiconIDThe lexicon ID.
TPronunciationID aPronunciationIDThe pronunciation ID.
TRuleID & aRuleIDA reference to where a new rule ID is assigned.

Cancel()

IMPORT_C voidCancel()

Cancels the current operation.

8.0

CommitChanges()

IMPORT_C TIntCommitChanges()

Commits the current train operation to the database.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

CreateGrammar(TGrammarID &)

IMPORT_C TIntCreateGrammar(TGrammarID &aGrammarID)

Creates a new grammar.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID & aGrammarIDA reference to where the grammar ID is stored.

CreateLexicon(TLexiconID &)

IMPORT_C TIntCreateLexicon(TLexiconID &aLexiconID)

Creates a new lexicon.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TLexiconID & aLexiconIDA reference where lexicon ID is stored.

CreateModelBank(TModelBankID &)

IMPORT_C TIntCreateModelBank(TModelBankID &aModelBankID)

Creates a new model bank.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

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

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

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

Parameters

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

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

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

Parameters

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

DoRecognizeL(CSDClientResultSet &)

voidDoRecognizeL(CSDClientResultSet &aResultSet)[private]

Parameters

CSDClientResultSet & aResultSet

EndRecSession()

IMPORT_C TIntEndRecSession()

Ends the current recognition session.

The resources allocated for recognition are freed.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

ExternalizeIntArrayL(const RArray< TInt > &)

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

Parameters

const RArray< TInt > & aArray

GetAllClientGrammarIDs()

IMPORT_C TIntGetAllClientGrammarIDs()

Returns all grammar IDs owned by the client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

GetAllClientLexiconIDs()

IMPORT_C TIntGetAllClientLexiconIDs()

Returns all lexicon IDs owned by the client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

GetAllClientModelBankIDs()

IMPORT_C TIntGetAllClientModelBankIDs()

Returns all modelBank IDs owned by the client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

GetAllGrammarIDs()

IMPORT_C TIntGetAllGrammarIDs()

Returns all grammar IDs owned by the client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

GetAllLexiconIDs()

IMPORT_C TIntGetAllLexiconIDs()

Returns all lexicon IDs owned by the client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

GetAllModelBankIDs()

IMPORT_C TIntGetAllModelBankIDs()

Returns all modelBank IDs owned by the client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

GetAllModelIDs(TModelBankID)

IMPORT_C TIntGetAllModelIDs(TModelBankIDaModelBankID)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.

GetAllPronunciationIDs(TLexiconID)

IMPORT_C TIntGetAllPronunciationIDs(TLexiconIDaLexiconID)

Returns all pronunciation IDs that exist in the specified lexicon.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TLexiconID aLexiconIDThe lexicon ID.

GetAllRuleIDs(TGrammarID)

IMPORT_C TIntGetAllRuleIDs(TGrammarIDaGrammarID)

Returns all rule IDs that exist in the specified grammar.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID.

GetAvailableStorage(TInt &)

IMPORT_C TIntGetAvailableStorage(TInt &aAvailableStorage)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

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

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

IMPORT_C TIntGetEngineProperties(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.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

const RArray< TInt > & aPropertyIdA constant reference to an array of engine property IDs.
RArray< TInt > & aPropertyValueA reference to an array of engine property values.

GetGrammarIDArrayL(RArray< TGrammarID > &)

IMPORT_C voidGetGrammarIDArrayL(RArray< TGrammarID > &aGrammarIDs)

Gets an array of grammar IDs previously requested by GetAllGrammarIDs.

8.0

Parameters

RArray< TGrammarID > & aGrammarIDsAn array to store grammar IDs.

GetLexiconIDArrayL(RArray< TLexiconID > &)

IMPORT_C voidGetLexiconIDArrayL(RArray< TLexiconID > &aLexiconIDs)

Gets an array of lexicon IDs previously requested by GetAllLexiconIDs.

8.0

Parameters

RArray< TLexiconID > & aLexiconIDsAn array to store lexicon IDs.

GetModelBankIDArrayL(RArray< TModelBankID > &)

IMPORT_C voidGetModelBankIDArrayL(RArray< TModelBankID > &aModelBankIDs)

Gets an array of modelBank IDs previously requested by GetAllModelBankIDs.

8.0

Parameters

RArray< TModelBankID > & aModelBankIDsAn array to store modelBank IDs.

GetModelCount(TModelBankID, TInt &)

IMPORT_C TIntGetModelCount(TModelBankIDaModelBankID,
TInt &aModelCount
)

Returns the number of models in the specified model bank.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.
TInt & aModelCountThe reference where the number of models is set.

GetModelIDArrayL(RArray< TModelID > &)

IMPORT_C voidGetModelIDArrayL(RArray< TModelID > &aModelIDs)

Gets an array of model IDs previously requested by GetAllModelIDs.

8.0

Parameters

RArray< TModelID > & aModelIDsAn array to store model IDs.

GetPronunciationIDArrayL(RArray< TPronunciationID > &)

IMPORT_C voidGetPronunciationIDArrayL(RArray< TPronunciationID > &aPronunciationIDs)

Gets an array of pronunciation IDs previously requested by GetAllPronunciationIDs.

8.0

Parameters

RArray< TPronunciationID > & aPronunciationIDsAn array to store pronunciation IDs.

GetResultSetL(CSDClientResultSet &)

IMPORT_C voidGetResultSetL(CSDClientResultSet &aResultSet)

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

8.0

Parameters

CSDClientResultSet & aResultSetThe ResultSet used to contain the recognition results

GetRuleIDArrayL(RArray< TRuleID > &)

IMPORT_C voidGetRuleIDArrayL(RArray< TRuleID > &aRuleIDs)

Gets an array of rule IDs previously requested by GetAllRuleIDs.

8.0

Parameters

RArray< TRuleID > & aRuleIDsAn array to store rule IDs.

GetRuleValidity(TGrammarID, TRuleID, TBool &)

IMPORT_C TIntGetRuleValidity(TGrammarIDaGrammarID,
TRuleIDaRuleID,
TBool &aValid
)

Checks if the rule is valid or not.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID.
TRuleID aRuleIDThe rule ID.
TBool & aValidA reference where the validity of the rule is set.

GetUtteranceDuration(TModelBankID, TModelID, TTimeIntervalMicroSeconds32 &)

IMPORT_C TIntGetUtteranceDuration(TModelBankIDaModelBankID,
TModelIDaModelID,
TTimeIntervalMicroSeconds32 &aDuration
)

Returns the duration of the utterance for the specified model. 8.0

System-wide errors

Parameters

TModelBankID aModelBankIDmodel bank Id
TModelID aModelIDmodel Id
TTimeIntervalMicroSeconds32 & aDurationreference where the duration of utterance is set

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

voidInternalizeIntArrayL(TDes8 &aDes,
TIntaNumberElements,
RArray< TInt > &aArray
)[private]

Parameters

TDes8 & aDes
TInt aNumberElements
RArray< TInt > & aArray

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

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

Uploads the specified parameters into the engine.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

const RArray< TInt > & aParameterIdAn array of parameter IDs.
const RArray< TInt > & aParameterValueAn array of parameter values.

LoadGrammar(TGrammarID)

IMPORT_C TIntLoadGrammar(TGrammarIDaGrammarID)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID.

LoadLexicon(TLexiconID)

IMPORT_C TIntLoadLexicon(TLexiconIDaLexiconID)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TLexiconID aLexiconIDThe lexicon ID.

LoadModels(TModelBankID)

IMPORT_C TIntLoadModels(TModelBankIDaModelBankID)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.

PlayUtterance(TModelBankID, TModelID)

IMPORT_C TIntPlayUtterance(TModelBankIDaModelBankID,
TModelIDaModelID
)

Plays the previously trained utterance.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.
TModelID aModelIDThe model ID, whose utterance is played.

Recognize(CSDClientResultSet &)

IMPORT_C TIntRecognize(CSDClientResultSet &aResultSet)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

CSDClientResultSet & aResultSetA reference where the recognition result is set.

Record(TTimeIntervalMicroSeconds32)

IMPORT_C TIntRecord(TTimeIntervalMicroSeconds32aRecordTime)

Records the user utterance for training and recognition.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TTimeIntervalMicroSeconds32 aRecordTimeThe recording time in microseconds.

RemoveGrammar(TGrammarID)

IMPORT_C TIntRemoveGrammar(TGrammarIDaGrammarID)

Removes the specified grammar from the permanent storage.

Removing a grammar will remove all rules within the grammar.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID.

RemoveLexicon(TLexiconID)

IMPORT_C TIntRemoveLexicon(TLexiconIDaLexiconID)

Removes the specified lexicon from the permanent storage.

Removing a lexicon will remove all pronunciations within the lexicon.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TLexiconID aLexiconIDThe lexicon ID.

RemoveModel(TModelBankID, TModelID)

IMPORT_C TIntRemoveModel(TModelBankIDaModelBankID,
TModelIDaModelID
)

Removes the specified model from the specified model bank permanently.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.
TModelID aModelIDThe model ID.

RemoveModelBank(TModelBankID)

IMPORT_C TIntRemoveModelBank(TModelBankIDaModelBankID)

Removes the specified model bank from the permanent storage.

Removing a model bank will remove all models within the model bank.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.

RemovePronunciation(TLexiconID, TPronunciationID)

IMPORT_C TIntRemovePronunciation(TLexiconIDaLexiconID,
TPronunciationIDaPronunciationID
)

Removes the specified pronunciation from the specified lexicon permanently.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TLexiconID aLexiconIDThe lexicon ID.
TPronunciationID aPronunciationIDThe pronunciation ID.

RemoveRule(TGrammarID, TRuleID)

IMPORT_C TIntRemoveRule(TGrammarIDaGrammarID,
TRuleIDaRuleID
)

Removes the specified rule from the specified grammar permanently.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID.
TRuleID aRuleIDThe rule ID.

SetClientUid(TUid)

IMPORT_C TIntSetClientUid(TUidaClientUid)

Sets the client UID for client.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TUid aClientUidThe client UID.

StartRecSession(TRecognitionMode)

IMPORT_C TIntStartRecSession(TRecognitionModeaMode)

Starts a new recognition session.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TRecognitionMode aModeThe recognition mode.

Train(TModelBankID, TModelID &)

IMPORT_C TIntTrain(TModelBankIDaModelBankID,
TModelID &aModelID
)

Trains a new model into the specified model bank.

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TModelBankID aModelBankIDThe model bank ID.
TModelID & aModelIDThe reference to where a new model ID is assigned.

UnloadRule(TGrammarID, TRuleID)

IMPORT_C TIntUnloadRule(TGrammarIDaGrammarID,
TRuleIDaRuleID
)

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

An error code indicating if the function call was successful. KErrNone on success, otherwise another of the system-wide error codes.

8.0

Parameters

TGrammarID aGrammarIDThe grammar ID.
TRuleID aRuleIDThe rule ID.

Member Data Documentation

TAny * iReservedPtr_1

TAny *iReservedPtr_1[private]

TAny * iReservedPtr_2

TAny *iReservedPtr_2[private]