Modules | Files | Inheritance Tree | Inheritance Graph | Name Index
module GNOME::Speech::Recognition
interface FinalResult
Files: GNOME_Speech.idl
GNOME-Speech-Recognition-FinalResult-inheritance GNOME-Speech-Recognition-FinalDictationResult.html GNOME-Speech-Recognition-FinalRuleResult.html GNOME-Speech-Recognition-Result.html GNOME-Speech-SpeechObject.html Bonobo-Unknown.html
Operations Summary:
AudioClipgetAudio() raises
AudioClipgetAudioForToken(in ResultToken fromToken, in ResultToken toToken) raises
 booleanisAudioAvailable() raises
 voidreleaseAudio() raises
 booleanisTrainingInfoAvailable() raises
 voidreleaseTrainingInfo() raises
 voidtokenCorrection(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:
AudioClip getAudio() raises (ResultStateError)

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.

Return:
the result audio for the complete utterance of a FinalResult.
See Also:
isAudioAvailable
getAudioForToken


AudioClip getAudioForToken(in ResultToken fromToken, in ResultToken toToken) raises (IllegalArgumentException, ResultStateError)

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.

Parameters:
fromToken - the start token.
toToken - the end token.
Return:
the audio for a token or sequence of tokens.
See Also:
getAudio


 boolean isAudioAvailable() raises (ResultStateError)

Test whether result audio data is available for this result. Result audio is only available if:

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.

Return:
an indication of whether result audio data is available for this result.
See Also:
getAudio
RecognizerProperties#setResultAudioProvided


 void releaseAudio() raises (ResultStateError)

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

See Also:
ResultEvent#AUDIO_RELEASED
ResultListener#audioReleased


 boolean isTrainingInfoAvailable() raises (ResultStateError)

Returns true if the Recognizer has training information available for this result. Training is available if the following conditions are met:

Calls to tokenCorrection have no effect if the training information is not available.

Return:
a boolean indication of whether training information is available.
See Also:
RecognizerProperties#setTrainingProvided
releaseTrainingInfo


 void releaseTrainingInfo() raises (ResultStateError)

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

See Also:
ResultEvent#TRAINING_INFO_RELEASED


 void tokenCorrection(in StringArray correctTokens, in ResultToken fromToken, in ResultToken toToken, in long correctionType) raises (IllegalArgumentException, ResultStateError)

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.

Parameters:
correctTokens - sequence of correct tokens to replace fromToken to toToken.
fromToken - first token in the sequence being corrected.
toToken - last token in the sequence being corrected.
correctionType - type of correction: MISRECOGNITION, USER_CHANGE, DONT_KNOW.
See Also:
MISRECOGNITION
USER_CHANGE
DONT_KNOW