CDevASR Class Reference

class CDevASR : public CBase

Interface Class for the DevASR API.

NssDevASR.lib
Since
2.8

Inherits from

Public Member Functions
~CDevASR()
IMPORT_C voidActivateGrammarL(TSIGrammarID)
IMPORT_C voidAdaptL(const CSIResultSet &, TInt)
IMPORT_C voidCancel()
IMPORT_C voidCompileGrammarL(CSICompiledGrammar &)
IMPORT_C voidComputeNewGrammarSizeL(const CSIGrammar &, const TUint32, const TUint32, const RArray< TUint > &, RArray< TUint > &, TUint32 &)
IMPORT_C TAny *CustomInterface(TUid)
IMPORT_C voidDeactivateGrammarL(TSIGrammarID)
IMPORT_C voidEndRecSession()
IMPORT_C voidEndRecord()
IMPORT_C voidGetEnginePropertiesL(const RArray< TInt > &, RArray< TInt > &)
IMPORT_C voidGetUtteranceData(TDes8 *, TTimeIntervalMicroSeconds32 &)
IMPORT_C voidInitFrontEnd(TRecognizerMode)
IMPORT_C voidInitRecognizerBE(CSIResultSet &)
IMPORT_C TBoolIsGrammarActive(TSIGrammarID)
IMPORT_C TBoolIsGrammarLoaded(TSIGrammarID)
IMPORT_C voidLoadEngineParametersL(const RArray< TInt > &, const RArray< TInt > &)
IMPORT_C voidLoadGrammar(const CSIGrammar &)
IMPORT_C voidLoadGrammar(const CSICompiledGrammar &)
IMPORT_C voidLoadLexicon(const CSILexicon &)
IMPORT_C voidLoadModels(const CSIModelBank &)
IMPORT_C CDevASR *NewL(MDevASRObserver &)
IMPORT_C CDevASR *NewLC(MDevASRObserver &)
IMPORT_C voidPreStartSamplingL()
IMPORT_C TBoolPruneGrammar(const CSIGrammar &, const TUint32, RArray< TSIRuleVariantInfo > &)
IMPORT_C voidRecord(TTimeIntervalMicroSeconds32)
IMPORT_C voidSendSpeechData(TPtrC8 &, TBool)
IMPORT_C voidSetPrioritySettings(const TMMFPrioritySettings &)
IMPORT_C TIntStartRecSession(TRecognizerMode)
IMPORT_C voidStartTrainingFromTextL(CSITtpWordList &, const RArray< TLanguage > &, const RArray< TUint32 > &)
IMPORT_C voidUnloadGrammar(const CSIGrammar &)
IMPORT_C voidUnloadGrammar(const CSICompiledGrammar &)
IMPORT_C voidUnloadRule(TSIGrammarID, TSIRuleID)
Private Member Functions
CDevASR()
voidConstructL(MDevASRObserver &)
Inherited Functions
CBase::CBase()
CBase::Delete(CBase *)
CBase::Extension_(TUint,TAny *&,TAny *)
CBase::operator new(TUint)
CBase::operator new(TUint,TAny *)
CBase::operator new(TUint,TLeave)
CBase::operator new(TUint,TLeave,TUint)
CBase::operator new(TUint,TUint)
CBase::~CBase()
Private Attributes
TAny *iReserved1
TAny *iReserved2
CSRSAlgorithmManager *iSRSAlgorithmManager

Constructor & Destructor Documentation

CDevASR()

CDevASR()[private]

C++ default constructor.

~CDevASR()

IMPORT_C~CDevASR()[virtual]

Destructor.

Member Functions Documentation

ActivateGrammarL(TSIGrammarID)

IMPORT_C voidActivateGrammarL(TSIGrammarIDaGrammarID)

Activates a grammar.

Since
2.8

Parameters

TSIGrammarID aGrammarID

AdaptL(const CSIResultSet &, TInt)

IMPORT_C voidAdaptL(const CSIResultSet &aResultSet,
TIntaResultIndex
)

Adapts vocabulary and models after successful recognition.

Since
2.8

Parameters

const CSIResultSet & aResultSet
TInt aResultIndex

Cancel()

IMPORT_C voidCancel()
Cancels the current or started tasks.
Since
2.8

CompileGrammarL(CSICompiledGrammar &)

IMPORT_C voidCompileGrammarL(CSICompiledGrammar &aGrammar)

Compiles an SI grammar.

Since
2.8

Parameters

CSICompiledGrammar & aGrammar

ComputeNewGrammarSizeL(const CSIGrammar &, const TUint32, const TUint32, const RArray< TUint > &, RArray< TUint > &, TUint32 &)

IMPORT_C voidComputeNewGrammarSizeL(const CSIGrammar &aGrammar,
const TUint32aTargetNRuleVariants,
const TUint32aMaxNRuleVariants,
const RArray< TUint > &aNewRuleScores,
RArray< TUint > &aNewRuleVariants,
TUint32 &aNPrune
)

Computes number of rule variants for grammar.

Since
2.8

Parameters

const CSIGrammar & aGrammar
const TUint32 aTargetNRuleVariants
const TUint32 aMaxNRuleVariants
const RArray< TUint > & aNewRuleScores
RArray< TUint > & aNewRuleVariants
TUint32 & aNPrune

ConstructL(MDevASRObserver &)

voidConstructL(MDevASRObserver &aObserver)[private]

By default Symbian 2nd phase constructor is private.

Parameters

MDevASRObserver & aObserver

CustomInterface(TUid)

IMPORT_C TAny *CustomInterface(TUidaInterfaceId)

Use to request a custom interface implementation from the component. through the DevASR API.

Since
2.8

Parameters

TUid aInterfaceId

DeactivateGrammarL(TSIGrammarID)

IMPORT_C voidDeactivateGrammarL(TSIGrammarIDaGrammarID)

Deactivates a grammar.

Since
2.8

Parameters

TSIGrammarID aGrammarID

EndRecSession()

IMPORT_C voidEndRecSession()

This method is used to indicate the end of a recognition session. All loaded grammars, lexicon, and models become invalid after this call.

Since
2.8

EndRecord()

IMPORT_C voidEndRecord()

Requests to end recording and a result will be resolved.

Since
2.8

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

IMPORT_C voidGetEnginePropertiesL(const RArray< TInt > &aPropertyId,
RArray< TInt > &aPropertyValue
)

Retreive the properties of the underlying speech recognition engine.

Since
2.8

Parameters

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

GetUtteranceData(TDes8 *, TTimeIntervalMicroSeconds32 &)

IMPORT_C voidGetUtteranceData(TDes8 *aBuffer,
TTimeIntervalMicroSeconds32 &aDuration
)

Retreive the raw audio data accumulated during recording.

Since
2.8

Parameters

TDes8 * aBuffer
TTimeIntervalMicroSeconds32 & aDuration

InitFrontEnd(TRecognizerMode)

IMPORT_C voidInitFrontEnd(TRecognizerModeaMode)

Initializes the front-end module in the speech recognition engine. The frontend module used during training/recognition functions is started as a result. This method is intended to be used in conjunction with InitTrainBE().

Since
2.8

Parameters

TRecognizerMode aMode

InitRecognizerBE(CSIResultSet &)

IMPORT_C voidInitRecognizerBE(CSIResultSet &aResult)

Initialize the recognition engine back-end. The module responsible for recognition function is started as a result. This method must be used before any recognition operations and intended to be used in conjunction with InitFrontEnd().

Since
2.8

Parameters

CSIResultSet & aResult

IsGrammarActive(TSIGrammarID)

IMPORT_C TBoolIsGrammarActive(TSIGrammarIDaGrammarID)

Checks if grammar is active or not

Since
2.8

Parameters

TSIGrammarID aGrammarID

IsGrammarLoaded(TSIGrammarID)

IMPORT_C TBoolIsGrammarLoaded(TSIGrammarIDaGrammarID)

Checks if grammar is loaded or not

Since
2.8

Parameters

TSIGrammarID aGrammarID

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

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

Load the specified recognizer parameter(s). These parameters are used to alter the recognizer's default parameters. The parameters are specified as attribute-value pairs.

Since
2.8

Parameters

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

LoadGrammar(const CSIGrammar &)

IMPORT_C voidLoadGrammar(const CSIGrammar &aGrammar)

Load the specified grammar into the recognizer.

Since
2.8

Parameters

const CSIGrammar & aGrammar

LoadGrammar(const CSICompiledGrammar &)

IMPORT_C voidLoadGrammar(const CSICompiledGrammar &aGrammar)

Load the specified grammar into the recognizer.

Since
2.8

Parameters

const CSICompiledGrammar & aGrammar

LoadLexicon(const CSILexicon &)

IMPORT_C voidLoadLexicon(const CSILexicon &aLexicon)

Load the specified SI lexicon into the recognizer.

Since
2.8

Parameters

const CSILexicon & aLexicon

LoadModels(const CSIModelBank &)

IMPORT_C voidLoadModels(const CSIModelBank &aModels)

Load the specified model bank into the recognizer.

Since
2.8

Parameters

const CSIModelBank & aModels

NewL(MDevASRObserver &)

IMPORT_C CDevASR *NewL(MDevASRObserver &aObserver)[static]

Two-phased constructors.

Parameters

MDevASRObserver & aObserver

NewLC(MDevASRObserver &)

IMPORT_C CDevASR *NewLC(MDevASRObserver &aObserver)[static]

Parameters

MDevASRObserver & aObserver

PreStartSamplingL()

IMPORT_C voidPreStartSamplingL()

Starts sampling before Record call.

Since
3.2

PruneGrammar(const CSIGrammar &, const TUint32, RArray< TSIRuleVariantInfo > &)

IMPORT_C TBoolPruneGrammar(const CSIGrammar &aGrammar,
const TUint32aMinNumber,
RArray< TSIRuleVariantInfo > &aPrunedRuleVariants
)

Determines which rule variants can be removed.

Since
2.8

Parameters

const CSIGrammar & aGrammar
const TUint32 aMinNumber
RArray< TSIRuleVariantInfo > & aPrunedRuleVariants

Record(TTimeIntervalMicroSeconds32)

IMPORT_C voidRecord(TTimeIntervalMicroSeconds32aRecordDuration)

Request to begin recognition.

Since
2.8

Parameters

TTimeIntervalMicroSeconds32 aRecordDuration

SendSpeechData(TPtrC8 &, TBool)

IMPORT_C voidSendSpeechData(TPtrC8 &aBuffer,
TBoolaEnd
)

Use to send the utterance data as a response to the RequestSpeechData().

Since
2.8

Parameters

TPtrC8 & aBuffer
TBool aEnd

SetPrioritySettings(const TMMFPrioritySettings &)

IMPORT_C voidSetPrioritySettings(const TMMFPrioritySettings &aPrioritySettings)

Use to set the priority of the sound device.

Since
2.8

Parameters

const TMMFPrioritySettings & aPrioritySettings

StartRecSession(TRecognizerMode)

IMPORT_C TIntStartRecSession(TRecognizerModeaMode)

This method is used to start a recognition session with the recognition engine.

Since
2.8

Parameters

TRecognizerMode aMode

StartTrainingFromTextL(CSITtpWordList &, const RArray< TLanguage > &, const RArray< TUint32 > &)

IMPORT_C voidStartTrainingFromTextL(CSITtpWordList &aWordList,
const RArray< TLanguage > &aDefaultLanguage,
const RArray< TUint32 > &aMaxNPronunsForWord
)

Starts training from text

Since
2.8

Parameters

CSITtpWordList & aWordList
const RArray< TLanguage > & aDefaultLanguage
const RArray< TUint32 > & aMaxNPronunsForWord

UnloadGrammar(const CSIGrammar &)

IMPORT_C voidUnloadGrammar(const CSIGrammar &aGrammar)

Unloads the specified grammar from the recognizer.

Since
2.8

Parameters

const CSIGrammar & aGrammar

UnloadGrammar(const CSICompiledGrammar &)

IMPORT_C voidUnloadGrammar(const CSICompiledGrammar &aGrammar)

Unloads the specified grammar from the recognizer.

Since
2.8

Parameters

const CSICompiledGrammar & aGrammar

UnloadRule(TSIGrammarID, TSIRuleID)

IMPORT_C voidUnloadRule(TSIGrammarIDaGrammarID,
TSIRuleIDaRuleID
)

Request to unload the specified rule in the grammar from recognizer.

Since
2.8

Parameters

TSIGrammarID aGrammarID
TSIRuleID aRuleID

Member Data Documentation

TAny * iReserved1

TAny *iReserved1[private]

TAny * iReserved2

TAny *iReserved2[private]

CSRSAlgorithmManager * iSRSAlgorithmManager

CSRSAlgorithmManager *iSRSAlgorithmManager[private]