Symbian
Symbian OS Library

SYMBIAN OS V9.2

[Index] [Spacer] [Previous] [Next]



Location: devASR.h

Class CDevASR

class CDevASR : public CBase;

Description

Interface Class for the DevASR API.

Derivation

Members

Defined in CDevASR:
Cancel(), Cancel(), CustomInterface(), CustomInterface(), EndRecSession(), EndRecSession(), GetEnginePropertiesL(), GetEnginePropertiesL(), GetUtteranceData(), GetUtteranceData(), InitFrontEnd(), InitFrontEnd(), InitPlayL(), InitPlayL(), InitRecognizerBE(), InitRecognizerBE(), InitTrainBE(), InitTrainBE(), LoadEngineParametersL(), LoadEngineParametersL(), LoadGrammar(), LoadGrammar(), LoadLexicon(), LoadLexicon(), LoadModels(), LoadModels(), NewL(), NewL(), NewLC(), NewLC(), Play(), Play(), Record(), Record(), SetPrioritySettings(), SetPrioritySettings(), StartRecSession(), StartRecSession(), UnloadRule(), UnloadRule(), ~CDevASR(), ~CDevASR()

Inherited from CBase:
Delete(), Extension_(), operator new()


Construction and destruction


NewL()

static IMPORT_C CDevASR *NewL(MDevASRObserver &aObserver);

Description

Two-phased constructor.

Parameters

MDevASRObserver &aObserver

The observer to call back when events occur

Return value

CDevASR *

pointer to object of type CDevASR


NewLC()

static IMPORT_C CDevASR *NewLC(MDevASRObserver &aObserver);

Description

Two-phased constructor.

Parameters

MDevASRObserver &aObserver

The observer to call back when events occur

Return value

CDevASR *

pointer to object of type CDevASR


~CDevASR()

virtual IMPORT_C ~CDevASR();

Description

Destructor.

[Top]


Member functions


Cancel()

IMPORT_C void Cancel();

Description

Cancels the current or started tasks.


CustomInterface()

IMPORT_C TAny *CustomInterface(TUid aInterfaceId);

Description

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

Parameters

TUid aInterfaceId

- Interface UID, defined with the custom interface.

Return value

TAny *

a pointer to the interface implementation, or NULL if the requested interface is not implemented. The return value must be cast to the correct type by the user.


EndRecSession()

IMPORT_C void EndRecSession();

Description

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


GetEnginePropertiesL()

IMPORT_C void GetEnginePropertiesL(const RArray< TInt > &aPropertyId, RArray< TInt > &aPropertyValue);

Description

Retreive the properties of the underlying speech recognition engine.

Parameters

const RArray< TInt > &aPropertyId

An array of identifiers being querried

RArray< TInt > &aPropertyValue

An array of values corresponding to the querried identifiers


InitFrontEnd()

IMPORT_C void InitFrontEnd(TRecognizerMode aMode);

Description

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().

Parameters

TRecognizerMode aMode

- Mode of the recognizer


InitPlayL()

IMPORT_C TDes8 &InitPlayL(TTimeIntervalMicroSeconds32 aPlayDuration);

Description

Perform any necessary initialization or allocation of the audio resource for playing a voice sample. A buffer to hold audio data to play is allocated. If allocation fails, this method will leave. Client is responsible for filling the buffer with their audio data and invoke Play() on DevASR.

Parameters

TTimeIntervalMicroSeconds32 aPlayDuration

- Specifies the duration of playback in microseconds

Return value

TDes8 &

A reference to the buffer to be filled with source audio data.


InitRecognizerBE()

IMPORT_C void InitRecognizerBE(CSDResultSet &aResult);

Description

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().

Parameters

CSDResultSet &aResult

- a reference to an object where the recognition result will be written


InitTrainBE()

IMPORT_C void InitTrainBE(CSDModel &aModel);

Description

Initializes the back-end module in the speech recognition engine. The back-end module responsible for training functions is started as a result. This method is intended to be used in conjunction with InitFrontEnd().

Parameters

CSDModel &aModel

- Buffer in which the newly created model will be written


LoadEngineParametersL()

IMPORT_C void LoadEngineParametersL(const RArray< TInt > &aParameterId, const RArray< TInt > &aParameterValue);

Description

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.

Parameters

const RArray< TInt > &aParameterId

- An array of parameter identifiers

const RArray< TInt > &aParameterValue

- An array of parameter values


LoadGrammar()

IMPORT_C void LoadGrammar(const CSDGrammar &aGrammar);

Description

Load the specified grammar into the recognizer.

Parameters

const CSDGrammar &aGrammar

- A reference to a grammar in an internal format


LoadLexicon()

IMPORT_C void LoadLexicon(const CSDLexicon &aLexicon);

Description

Load the specified grammar into the recognizer.

Parameters

const CSDLexicon &aLexicon

- A reference to a lexicon in an internal format


LoadModels()

IMPORT_C void LoadModels(const CSDModelBank &aModels);

Description

Load the specified Lexicon into the recognizer.

Parameters

const CSDModelBank &aModels

- A reference to a model bank


Play()

IMPORT_C void Play();

Description

Request DevASR to play the contents of its own buffer. The buffer was previously allocated by invoking method InitPlay().


Record()

IMPORT_C void Record(TTimeIntervalMicroSeconds32 aRecordDuration);

Description

Request to begin recording.

Parameters

TTimeIntervalMicroSeconds32 aRecordDuration

- Length of time to record, expressed in microseconds


SetPrioritySettings()

Capability: MultimediaDDFor applications that do not have the MultimediaDD capability, any supplied priority level (aPrioritySettings) will be ignored.

IMPORT_C void SetPrioritySettings(const TMMFPrioritySettings &aPrioritySettings);

Description

Use to set the priority of the sound device

Parameters

const TMMFPrioritySettings &aPrioritySettings

Priority settings structure


StartRecSession()

IMPORT_C TInt StartRecSession(TRecognizerMode aMode);

Description

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

Parameters

TRecognizerMode aMode

Mode of the recognizer

Return value

TInt

result code of operation


UnloadRule()

IMPORT_C void UnloadRule(TGrammarID aGrammarID, TRuleID aRuleID);

Description

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

Parameters

TGrammarID aGrammarID

- Identifer of the grammar to operate on

TRuleID aRuleID

- Identifier of the rule to remove


GetUtteranceData()

IMPORT_C void GetUtteranceData(TDes8 *aBuffer, TTimeIntervalMicroSeconds32 &aDuration);

Description

Retreive the raw audio data accumulated during recording.

Parameters

TDes8 *aBuffer

Reference to a buffer containing the data

TTimeIntervalMicroSeconds32 &aDuration

Duration of the utterance