CSRSAlgorithmManager Class Reference
class CSRSAlgorithmManager : public CActive
|
Interface Class to be used by the DevASR thin client implementation.
NssDevASR.lib
Public Member Functions
|
|
~CSRSAlgorithmManager
()
|
void
|
ActivateGrammarComplete
(
TInt
)
|
void
|
ActivateGrammarL
(
TSIGrammarID
)
|
void
|
AdaptComplete
(
TInt
)
|
void
|
AdaptL
(const
CSIResultSet
&,
TInt
)
|
void
|
BufferToBeEmptied
(
CMMFBuffer
*)
|
void
|
BufferToBeFilled
(
CMMFBuffer
*)
|
void
|
Cancel
()
|
void
|
CombineComplete
(
HBufC8
*,
TInt
)
|
void
|
CombineGrammarL
(const
RPointerArray
<
CSICompiledGrammar
> &, const
RPointerArray
<
TSIRuleVariantInfo
> &)
|
void
|
CompileGrammarL
(
CSICompiledGrammar
&)
|
void
|
ComputeNewGrammarSizeL
(const
CSIGrammar
&, const
TUint32
, const
TUint32
, const
RArray
<
TUint
> &,
RArray
<
TUint
> &,
TUint32
&)
|
void
|
ConvertError
(
TInt
)
|
void
|
DeActivateGrammarComplete
(
TInt
)
|
void
|
DeactivateGrammarL
(
TSIGrammarID
)
|
void
|
DevASRState
()
|
void
|
DeviceMessage
(
TUid
, const
TDesC8
&)
|
void
|
EndRecSession
()
|
void
|
EouDetected
(
TInt
)
|
void
|
FeatureVectorDataRcvd
(const
TDesC8
&,
TInt32
,
TInt32
)
|
void
|
GetEnginePropertiesL
(const
RArray
<
TInt
> &,
RArray
<
TInt
> &)
|
void
|
GetGrammarL
(const
TSIGrammarID
,
CSICompiledGrammar
**,
CSICompiledGrammar
**)
|
void
|
GetUtteranceData
(
TDes8
*,
TTimeIntervalMicroSeconds32
&)
|
void
|
InitFEComplete
(
TInt
)
|
void
|
InitFrontEnd
(
TRecognizerMode
)
|
void
|
InitRecognizerBE
(
CSIResultSet
&)
|
void
|
InitRecognizerBEComplete
(
TInt
)
|
void
|
InitializeComplete
(
TInt
)
|
TBool
|
IsGrammarActive
(
TSIGrammarID
)
|
TBool
|
IsGrammarLoaded
(
TSIGrammarID
)
|
void
|
LoadEnginePropertiesL
(const
RArray
<
TInt
> &, const
RArray
<
TInt
> &)
|
void
|
LoadGrammarComplete
(
TInt
)
|
void
|
LoadGrammarL
(const
CSIGrammar
&)
|
void
|
LoadGrammarL
(const
CSICompiledGrammar
&)
|
void
|
LoadLexiconComplete
(
TInt
)
|
void
|
LoadLexiconL
(const
CSILexicon
&)
|
void
|
LoadModelsComplete
(
TInt
)
|
void
|
LoadModelsL
(const
CSIModelBank
&)
|
CSRSAlgorithmManager
*
|
NewL
(
MDevASRObserver
&)
|
CSRSAlgorithmManager
*
|
NewLC
(
MDevASRObserver
&)
|
void
|
PlayError
(
TInt
)
|
void
|
PreStartSamplingL
()
|
TBool
|
PruneGrammar
(const
CSIGrammar
&, const
TUint32
,
RArray
<
TSIRuleVariantInfo
> &)
|
void
|
RecognitionComplete
(
TInt
)
|
void
|
RecordError
(
TInt
)
|
void
|
RequestSpeechData
()
|
void
|
ResolveResult
(const
RArray
<
TUint
> &,
CSIResultSet
&, const
RPointerArray
<
CSICompiledGrammar
> &, const
TDesC8
&)
|
void
|
SendEventToClient
(const
TMMFEvent
&)
|
void
|
SendSpeechData
(
TPtrC8
&,
TBool
)
|
void
|
SetPrioritySettings
(const
TMMFPrioritySettings
&)
|
TInt
|
StartRecSession
(
TRecognizerMode
)
|
void
|
StartRecognition
(
TTimeIntervalMicroSeconds32
)
|
void
|
StartTrainingFromTextL
(
CSITtpWordList
&, const
RArray
<
TLanguage
> &, const
RArray
<
TUint32
> &)
|
void
|
StopRecognition
()
|
void
|
ToneFinished
(
TInt
)
|
void
|
TrainComplete
(
TInt
)
|
void
|
UnloadGrammarComplete
(
TInt
)
|
void
|
UnloadGrammarL
(const
CSIGrammar
&)
|
void
|
UnloadGrammarL
(const
CSICompiledGrammar
&)
|
void
|
UnloadRule
(
TSIGrammarID
,
TSIRuleID
)
|
void
|
UnloadRuleComplete
(
TInt
)
|
Constructor & Destructor Documentation
CSRSAlgorithmManager(MDevASRObserver &)
~CSRSAlgorithmManager()
~CSRSAlgorithmManager
|
(
|
)
|
[virtual]
|
Member Functions Documentation
ActivateGrammarComplete(TInt)
void
|
ActivateGrammarComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked when grammar has been activated.
ActivateGrammarL(TSIGrammarID)
AdaptComplete(TInt)
void
|
AdaptComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the adaptation hw device when model adaptation has finished its processing.
AdaptL(const CSIResultSet &, TInt)
Adapts recognition models
BufferToBeEmptied(CMMFBuffer *)
Called by DevSound when a buffer is available to be read.
BufferToBeFilled(CMMFBuffer *)
Called by DevSound when a buffer is available to be written.
Cancel()
Cancels the current or started tasks.
CombineComplete(HBufC8 *, TInt)
void
|
CombineComplete
|
(
|
HBufC8
*
|
aResult,
|
|
TInt
|
aError
|
|
)
|
|
Notifies that grammar combination has been done.
CombineGrammarL(const RPointerArray< CSICompiledGrammar > &, const RPointerArray< TSIRuleVariantInfo > &)
Invoked when grammar combining is needed
CompileGrammarL(CSICompiledGrammar &)
Does grammar compilation.
ComputeNewGrammarSizeL(const CSIGrammar &, const TUint32, const TUint32, const RArray< TUint > &, RArray< TUint > &, TUint32 &)
Computes new grammar size with given number of variants.
ConfigureSoundDeviceL()
void
|
ConfigureSoundDeviceL
|
(
|
)
|
[private]
|
Configure the sound device according to parameters in the resource file.
ConstructL()
void
|
ConstructL
|
(
|
)
|
[private]
|
By default Symbian 2nd phase constructor is private.
ConvertError(TInt)
void
|
ConvertError
|
(
|
TInt
|
aError
|
)
|
|
DeActivateGrammarComplete(TInt)
void
|
DeActivateGrammarComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked when grammar has been deactivated.
DeactivateGrammarL(TSIGrammarID)
DevASRState()
Prints DevASR state information for debugging
DeviceMessage(TUid, const TDesC8 &)
void
|
DeviceMessage
|
(
|
TUid
|
aMessageType,
|
|
const
TDesC8
&
|
aMsg
|
|
)
|
|
DoCancel()
void
|
DoCancel
|
(
|
)
|
[private, virtual]
|
Implements cancellation of an outstanding request.
This function is called as part of the active object's
Cancel()
.
It must call the appropriate cancel function offered by the active object's asynchronous service provider. The asynchronous service provider's cancel is expected to act immediately.
DoCancel()
must not wait for event completion; this is handled by
Cancel()
.
CActive::Cancel
EmptyBuffer(CMMFDataBuffer &, TInt)
Empties and copies the data to holding buffer.
EndRecSession()
This method is used to indicate the end of a recognition session.
EouDetected(TInt)
void
|
EouDetected
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the front-end when EOU has been detected.
FeatureVectorDataRcvd(const TDesC8 &, TInt32, TInt32)
Invoked when a feature vector is available.
FillBuffer(CMMFDataBuffer &, TInt)
Fill the received buffer with utterance data upto the specified length.
GetEnginePropertiesL(const RArray< TInt > &, RArray< TInt > &)
Retreive the properties of the underlying speech recognition engine.
GetGrammarL(const TSIGrammarID, CSICompiledGrammar **, CSICompiledGrammar **)
Get the specified grammar.
GetUtteranceData(TDes8 *, TTimeIntervalMicroSeconds32 &)
Retreive the raw audio data accumulated during recording.
HandlePlayL()
void
|
HandlePlayL
|
(
|
)
|
[private]
|
Async handler for a play request.
HandleRecordL()
void
|
HandleRecordL
|
(
|
)
|
[private]
|
Async handler for a record request.
HandleUtteranceDataProcessed()
void
|
HandleUtteranceDataProcessed
|
(
|
)
|
[private]
|
Async handler for a UtteranceDataProcessed event.
InitFEComplete(TInt)
void
|
InitFEComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the algorithm manager when the frontend initialization is completed.
InitFrontEnd(TRecognizerMode)
void
|
InitFrontEnd
|
(
|
TRecognizerMode
|
aFeMode
|
)
|
|
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().
InitRecognizerBE(CSIResultSet &)
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()
.
InitRecognizerBEComplete(TInt)
void
|
InitRecognizerBEComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the algorithm manager when the recognition backend initialization is completed.
InitializeComplete(TInt)
void
|
InitializeComplete
|
(
|
TInt
|
aError
|
)
|
|
Called by DevSound when initialization is completed.
Parameters
TInt
aError
|
Error code, KErrNone if successful.
|
InitializeDevSoundL()
void
|
InitializeDevSoundL
|
(
|
)
|
[private]
|
Initializes DevSound for sampling
IsGrammarActive(TSIGrammarID)
Checks if grammar is active or not
IsGrammarLoaded(TSIGrammarID)
Checks if grammar is loaded or not
LoadEnginePropertiesL(const RArray< TInt > &, const RArray< TInt > &)
void
|
LoadEnginePropertiesL
|
(
|
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.
LoadGrammarComplete(TInt)
void
|
LoadGrammarComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the algorithm manager when loading grammar is completed.
LoadGrammarL(const CSIGrammar &)
Load the specified grammar into the recognizer.
Parameters
const
CSIGrammar
& aGrammar
|
A reference to a grammar in an internal format.
|
LoadGrammarL(const CSICompiledGrammar &)
LoadLexiconComplete(TInt)
void
|
LoadLexiconComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the algorithm manager when loading lexicon is completed.
LoadLexiconL(const CSILexicon &)
Load the specified lexicon into the recognizer.
Parameters
const
CSILexicon
& aLexicon
|
A reference to a lexicon.
|
LoadModelsComplete(TInt)
void
|
LoadModelsComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked by the algorithm manager when loading models is completed.
LoadModelsL(const CSIModelBank &)
Load the specified models into the recognizer.
PlayError(TInt)
void
|
PlayError
|
(
|
TInt
|
aError
|
)
|
|
Handles play completion or cancel event from DevSound.
PreStartSamplingL()
void
|
PreStartSamplingL
|
(
|
)
|
|
Pre-starts recording before StartRecording call.
PruneGrammar(const CSIGrammar &, const TUint32, RArray< TSIRuleVariantInfo > &)
Prunes unnecessay rule variants away from grammar.
Ready(const TInt)
void
|
Ready
|
(
|
const
TInt
|
aStatus
|
)
|
[private]
|
Completes a request with specified status.
RecognitionComplete(TInt)
void
|
RecognitionComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked when the recognition process is completed.
RecordError(TInt)
void
|
RecordError
|
(
|
TInt
|
aError
|
)
|
|
Handles record completion or cancel event from DevSound.
Parameters
TInt
aError
|
Error code, KErrNone if successful.
|
RequestSpeechData()
void
|
RequestSpeechData
|
(
|
)
|
|
Invoked by the front-end when utterance data is needed.
ResolveResult(const RArray< TUint > &, CSIResultSet &, const RPointerArray< CSICompiledGrammar > &, const TDesC8 &)
RunL()
void
|
RunL
|
(
|
)
|
[private, virtual]
|
SendEventToClient(const TMMFEvent &)
void
|
SendEventToClient
|
(
|
const
TMMFEvent
&
|
aEvent
|
)
|
|
Handles audio policy events from DevSound.
SendSpeechData(TPtrC8 &, TBool)
Call to give speech data to recognizer.
SetPrioritySettings(const TMMFPrioritySettings &)
Use to set the priority of the sound device
StartDevSoundL()
void
|
StartDevSoundL
|
(
|
)
|
[private]
|
Starts sampling with DevSound
StartRecSession(TRecognizerMode)
TInt
|
StartRecSession
|
(
|
TRecognizerMode
|
aMode
|
)
|
|
Request to start a recognition session.
StartRecognition(TTimeIntervalMicroSeconds32)
Request to begin recording.
StartTrainingFromTextL(CSITtpWordList &, const RArray< TLanguage > &, const RArray< TUint32 > &)
Starts speaker independent training from text.
StateTransition(TDevASRState)
TBool
|
StateTransition
|
(
|
TDevASRState
|
aState
|
)
|
[private]
|
Transition from current state to target state if possible.
ToneFinished(TInt)
void
|
ToneFinished
|
(
|
TInt
|
aError
|
)
|
|
Handles tone play completion or cancel event from DevSound Tone is not used by DevASR so this event is not expected.
TrainComplete(TInt)
void
|
TrainComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked when the training process is completed.
TranslateError(TInt)
Translate system error codes to DevASR cause codes.
UnloadGrammarComplete(TInt)
void
|
UnloadGrammarComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked when grammar has been unloaded.
UnloadGrammarL(const CSIGrammar &)
void
|
UnloadGrammarL
|
(
|
const
CSIGrammar
&
|
aGrammar
|
)
|
|
Unloads the specified grammar from the recognizer.
Parameters
const
CSIGrammar
& aGrammar
|
A reference to a grammar in an internal format.
|
UnloadGrammarL(const CSICompiledGrammar &)
UnloadRule(TSIGrammarID, TSIRuleID)
Request to unload the specified rule in the grammar from recognizer.
UnloadRuleComplete(TInt)
void
|
UnloadRuleComplete
|
(
|
TInt
|
aResultCode
|
)
|
|
Invoked when rule unloading has been done.
Member Data Documentation
TUint8 * iAudioBuffer
TUint8
*
|
iAudioBuffer
|
[private]
|
TSglQue< CQueItem > * iAudioBufferQue
CActiveSchedulerWait
iAudioWait
TUint32
iBufferStartPoint
TUint32
|
iBufferStartPoint
|
[private]
|
TUint8 * iBufferUnderConstruction
TUint8
*
|
iBufferUnderConstruction
|
[private]
|
TInt
iConstructionPoint
TInt
|
iConstructionPoint
|
[private]
|
TInt
iCurrentGain
TInt
|
iCurrentGain
|
[private]
|
TInt
iCurrentVolume
TInt
|
iCurrentVolume
|
[private]
|
MDevASRObserver * iDevASRObserver
TDevASRState
iDevASRState
TDevASRState
|
iDevASRState
|
[private]
|
TMMFCapabilities
iDevSoundCapabilities
TDevSoundState
iDevSoundState
TDevSoundState
|
iDevSoundState
|
[private]
|
TReal
iFrameLength
TReal
|
iFrameLength
|
[private]
|
TRecognizerMode
iMode
TRecognizerMode
|
iMode
|
[private]
|
TInt
iOverallLength
TInt
|
iOverallLength
|
[private]
|
TInt
iOverallSampled
TInt
|
iOverallSampled
|
[private]
|
TBool
iPendingRequestSpeechData
TBool
|
iPendingRequestSpeechData
|
[private]
|
TBool
iPreSamplingStarted
TBool
|
iPreSamplingStarted
|
[private]
|
TMMFPrioritySettings
iPrioritySettings
TBool
iProcessingUtterance
TBool
|
iProcessingUtterance
|
[private]
|
CRecognitionAlgMgr * iRecognitionAlgMgr
TTimeIntervalMicroSeconds32
iRecordDuration
TInt
iRequestFunction
TInt
|
iRequestFunction
|
[private]
|
CDevASRResourceHandler * iResourceHandler
const CSILexicon * iSILexicon
const CSIModelBank * iSIModelBank
TBool
iStartRecognition
TBool
|
iStartRecognition
|
[private]
|
CVMAlgorithmManager * iVMAlgorithmManager
Copyright ©2010 Nokia Corporation and/or its subsidiary(-ies).
All rights
reserved. Unless otherwise stated, these materials are provided under the terms of the Eclipse Public License
v1.0.