»
Symbian OS v9.2 »
Symbian OS reference »
C++ component reference »
Multimedia MMF »
CDevASR
class CDevASR : public CBase;
Description
Interface Class for the DevASR API.
Derivation
CBase - Base class for all classes to be instantiated on the heapCDevASR - Interface Class for the DevASR API
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
static IMPORT_C CDevASR *NewL(MDevASRObserver &aObserver);
Description
Two-phased constructor.
Parameters
Return value
CDevASR * |
pointer to object of type CDevASR |
|
static IMPORT_C CDevASR *NewLC(MDevASRObserver &aObserver);
Description
Two-phased constructor.
Parameters
Return value
CDevASR * |
pointer to object of type CDevASR |
|
virtual IMPORT_C ~CDevASR();
Description
Destructor.
IMPORT_C void Cancel();
Description
Cancels the current or started tasks.
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. |
|
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.
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 |
|
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
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
Return value
TDes8 & |
A reference to the buffer to be filled with source audio data. |
|
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 |
|
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 |
|
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 |
|
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 |
|
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 |
|
IMPORT_C void LoadModels(const CSDModelBank &aModels);
Description
Load the specified Lexicon into the recognizer.
Parameters
IMPORT_C void Play();
Description
Request DevASR to play the contents of its own buffer. The buffer was previously allocated by invoking method InitPlay().
IMPORT_C void Record(TTimeIntervalMicroSeconds32 aRecordDuration);
Description
Request to begin recording.
Parameters
| Capability: | MultimediaDD | For 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
IMPORT_C TInt StartRecSession(TRecognizerMode aMode);
Description
This method is used to start a recognition session with the recognition engine.
Parameters
Return value
TInt
|
result code of operation |
|
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 |
|
IMPORT_C void GetUtteranceData(TDes8 *aBuffer, TTimeIntervalMicroSeconds32 &aDuration);
Description
Retreive the raw audio data accumulated during recording.
Parameters