Operations Summary: | |
AudioClip | getAudio() raises |
AudioClip | getAudioForToken(in ResultToken fromToken, in ResultToken toToken) raises |
boolean | isAudioAvailable() raises |
void | releaseAudio() raises |
boolean | isTrainingInfoAvailable() raises |
void | releaseTrainingInfo() raises |
void | tokenCorrection(in StringArray correctTokens, in ResultToken fromToken, in ResultToken toToken, in long correctionType) raises |
Operations Inherited from Result | |
addResultListener, removeResultListener, getBestToken, getBestTokens, getGrammar, getResultState, getUnfinalizedTokens, numTokens |
Operations Inherited from Bonobo::Unknown | |
ref, unref, queryInterface |
Operation Details: |
Get the result audio for the complete utterance of a
FinalResult
. Returns null if result audio
is not available or if it has been released.
FinalResult
. isAudioAvailable
getAudioForToken
Get the audio for a token or sequence of tokens. Recognizers make a best effort at determining the start and end of tokens, however, it is not unusual for chunks of surrounding audio to be included or for the start or end token to be chopped.
Returns null if result audio is not available or if it cannot be obtained for the specified sequence of tokens.
If toToken
is null or if fromToken
and
toToken
are the same, the method returns audio for
fromToken
. If both fromToken
and
toToken
are null, it returns the audio for the
entire result (same as getAudio
).
Not all recognizers can provide per-token audio, even if they can provide audio for a complete utterance.
getAudio
Test whether result audio data is available for this result. Result audio is only available if:
ResultAudioProvided
property of
RecognizerProperties
was set to true when
the result was recognized.
Recognizer
was able to collect result
audio for the current type of FinalResult
(FinalRuleResult
or
FinalDictationResult
).
The availability of audio for a result does not mean that all
getAudio
calls will return an AudioClip
.
For example, some recognizers might provide audio data only for
the entire result or only for individual tokens, or not for
sequences of more than one token.
getAudio
RecognizerProperties#setResultAudioProvided
Release the result audio for the result. After audio is released,
isAudioAvailable
will return false. This call is
ignored if result audio is not available or has already been
released.
This method is asynchronous - audio data is not necessarily
released immediately. A AUDIO_RELEASED
event is
issued to the ResultListener
when the audio is
released by a call to this method. A AUDIO_RELEASED
event is also issued if the recognizer releases the audio for
some other reason (e.g. to reclaim memory).
ResultEvent#AUDIO_RELEASED
ResultListener#audioReleased
Returns true if the Recognizer
has training
information available for this result. Training is available
if the following conditions are met:
isTrainingProvided
property of the
RecognizerProperties
is set to true.
TRAINING_INFO_RELEASED
event has not been
issued.)
Calls to tokenCorrection
have no effect if the training
information is not available.
RecognizerProperties#setTrainingProvided
releaseTrainingInfo
Release training information for this FinalResult
.
The release frees memory used for the training information --
this information can be substantial.
It is not an error to call the method when training information is not available or has already been released.
This method is asynchronous - the training info is not necessarily
released when the call returns. A
TRAINING_INFO_RELEASED
event is issued to the
ResultListener
once the information is released.
The TRAINING_INFO_RELEASED
event is also issued if
the recognizer releases the training information for any other
reason (e.g. to reclaim memory).
ResultEvent#TRAINING_INFO_RELEASED
Inform the recognizer of a correction to one of more tokens in a finalized result so that the recognizer can re-train itself. Training the recognizer from its mistakes allows it to improve its performance and accuracy in future recognition.
The fromToken
and toToken
parameters
indicate the inclusive sequence of best-guess or alternative
tokens that are being trained or corrected. If
toToken
is null or if fromToken
and
toToken
are the same, the training applies to a
single recognized token.
The correctTokens
token sequence may have the same
of a different length than the token sequence being corrected.
Setting correctTokens
to null indicates the
deletion of tokens. The correctionType
parameter
must be one of MISRECOGNITION
,
USER_CHANGE
, DONT_KNOW
.
Note: tokenCorrection
does not change the
result object. So, future calls to the getBestToken
,
getBestTokens
and getAlternativeTokens
method return exactly the same values as before the call to
tokenCorrection
.
fromToken
to toToken
.MISRECOGNITION
, USER_CHANGE
, DONT_KNOW
. MISRECOGNITION
USER_CHANGE
DONT_KNOW