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 void ActivateGrammarL ( TSIGrammarID )
IMPORT_C void AdaptL (const CSIResultSet &, TInt )
IMPORT_C void Cancel ()
IMPORT_C void CompileGrammarL ( CSICompiledGrammar &)
IMPORT_C void ComputeNewGrammarSizeL (const CSIGrammar &, const TUint32 , const TUint32 , const RArray < TUint > &, RArray < TUint > &, TUint32 &)
IMPORT_C TAny * CustomInterface ( TUid )
IMPORT_C void DeactivateGrammarL ( TSIGrammarID )
IMPORT_C void EndRecSession ()
IMPORT_C void EndRecord ()
IMPORT_C void GetEnginePropertiesL (const RArray < TInt > &, RArray < TInt > &)
IMPORT_C void GetUtteranceData ( TDes8 *, TTimeIntervalMicroSeconds32 &)
IMPORT_C void InitFrontEnd ( TRecognizerMode )
IMPORT_C void InitRecognizerBE ( CSIResultSet &)
IMPORT_C TBool IsGrammarActive ( TSIGrammarID )
IMPORT_C TBool IsGrammarLoaded ( TSIGrammarID )
IMPORT_C void LoadEngineParametersL (const RArray < TInt > &, const RArray < TInt > &)
IMPORT_C void LoadGrammar (const CSIGrammar &)
IMPORT_C void LoadGrammar (const CSICompiledGrammar &)
IMPORT_C void LoadLexicon (const CSILexicon &)
IMPORT_C void LoadModels (const CSIModelBank &)
IMPORT_C CDevASR * NewL ( MDevASRObserver &)
IMPORT_C CDevASR * NewLC ( MDevASRObserver &)
IMPORT_C void PreStartSamplingL ()
IMPORT_C TBool PruneGrammar (const CSIGrammar &, const TUint32 , RArray < TSIRuleVariantInfo > &)
IMPORT_C void Record ( TTimeIntervalMicroSeconds32 )
IMPORT_C void SendSpeechData ( TPtrC8 &, TBool )
IMPORT_C void SetPrioritySettings (const TMMFPrioritySettings &)
IMPORT_C TInt StartRecSession ( TRecognizerMode )
IMPORT_C void StartTrainingFromTextL ( CSITtpWordList &, const RArray < TLanguage > &, const RArray < TUint32 > &)
IMPORT_C void UnloadGrammar (const CSIGrammar &)
IMPORT_C void UnloadGrammar (const CSICompiledGrammar &)
IMPORT_C void UnloadRule ( TSIGrammarID , TSIRuleID )
Private Member Functions
CDevASR ()
void ConstructL ( 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 void ActivateGrammarL ( TSIGrammarID aGrammarID )

Activates a grammar.

Since
2.8

Parameters

TSIGrammarID aGrammarID

AdaptL(const CSIResultSet &, TInt)

IMPORT_C void AdaptL ( const CSIResultSet & aResultSet,
TInt aResultIndex
)

Adapts vocabulary and models after successful recognition.

Since
2.8

Parameters

const CSIResultSet & aResultSet
TInt aResultIndex

Cancel()

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

CompileGrammarL(CSICompiledGrammar &)

IMPORT_C void CompileGrammarL ( 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 void ComputeNewGrammarSizeL ( const CSIGrammar & aGrammar,
const TUint32 aTargetNRuleVariants,
const TUint32 aMaxNRuleVariants,
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 &)

void ConstructL ( MDevASRObserver & aObserver ) [private]

By default Symbian 2nd phase constructor is private.

Parameters

MDevASRObserver & aObserver

CustomInterface(TUid)

IMPORT_C TAny * CustomInterface ( TUid aInterfaceId )

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

Since
2.8

Parameters

TUid aInterfaceId

DeactivateGrammarL(TSIGrammarID)

IMPORT_C void DeactivateGrammarL ( TSIGrammarID aGrammarID )

Deactivates a grammar.

Since
2.8

Parameters

TSIGrammarID aGrammarID

EndRecSession()

IMPORT_C void EndRecSession ( )

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 void EndRecord ( )

Requests to end recording and a result will be resolved.

Since
2.8

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

IMPORT_C void GetEnginePropertiesL ( 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 void GetUtteranceData ( TDes8 * aBuffer,
TTimeIntervalMicroSeconds32 & aDuration
)

Retreive the raw audio data accumulated during recording.

Since
2.8

Parameters

TDes8 * aBuffer
TTimeIntervalMicroSeconds32 & aDuration

InitFrontEnd(TRecognizerMode)

IMPORT_C void InitFrontEnd ( TRecognizerMode aMode )

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 void InitRecognizerBE ( 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 TBool IsGrammarActive ( TSIGrammarID aGrammarID )

Checks if grammar is active or not

Since
2.8

Parameters

TSIGrammarID aGrammarID

IsGrammarLoaded(TSIGrammarID)

IMPORT_C TBool IsGrammarLoaded ( TSIGrammarID aGrammarID )

Checks if grammar is loaded or not

Since
2.8

Parameters

TSIGrammarID aGrammarID

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

IMPORT_C void LoadEngineParametersL ( 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 void LoadGrammar ( const CSIGrammar & aGrammar )

Load the specified grammar into the recognizer.

Since
2.8

Parameters

const CSIGrammar & aGrammar

LoadGrammar(const CSICompiledGrammar &)

IMPORT_C void LoadGrammar ( const CSICompiledGrammar & aGrammar )

Load the specified grammar into the recognizer.

Since
2.8

Parameters

const CSICompiledGrammar & aGrammar

LoadLexicon(const CSILexicon &)

IMPORT_C void LoadLexicon ( const CSILexicon & aLexicon )

Load the specified SI lexicon into the recognizer.

Since
2.8

Parameters

const CSILexicon & aLexicon

LoadModels(const CSIModelBank &)

IMPORT_C void LoadModels ( 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 void PreStartSamplingL ( )

Starts sampling before Record call.

Since
3.2

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

IMPORT_C TBool PruneGrammar ( const CSIGrammar & aGrammar,
const TUint32 aMinNumber,
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 void Record ( TTimeIntervalMicroSeconds32 aRecordDuration )

Request to begin recognition.

Since
2.8

Parameters

TTimeIntervalMicroSeconds32 aRecordDuration

SendSpeechData(TPtrC8 &, TBool)

IMPORT_C void SendSpeechData ( TPtrC8 & aBuffer,
TBool aEnd
)

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 void SetPrioritySettings ( const TMMFPrioritySettings & aPrioritySettings )

Use to set the priority of the sound device.

Since
2.8

Parameters

const TMMFPrioritySettings & aPrioritySettings

StartRecSession(TRecognizerMode)

IMPORT_C TInt StartRecSession ( TRecognizerMode aMode )

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 void StartTrainingFromTextL ( 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 void UnloadGrammar ( const CSIGrammar & aGrammar )

Unloads the specified grammar from the recognizer.

Since
2.8

Parameters

const CSIGrammar & aGrammar

UnloadGrammar(const CSICompiledGrammar &)

IMPORT_C void UnloadGrammar ( const CSICompiledGrammar & aGrammar )

Unloads the specified grammar from the recognizer.

Since
2.8

Parameters

const CSICompiledGrammar & aGrammar

UnloadRule(TSIGrammarID, TSIRuleID)

IMPORT_C void UnloadRule ( TSIGrammarID aGrammarID,
TSIRuleID aRuleID
)

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]