Interface Recognizer

ru.yandex.speechkit

public  interface  Recognizer 

All Known Implementing Classes:
OnlineRecognizer

Interface of the object that recognizes speech.

Methods

voidcancel()

Cancels the recognition request.

voiddestroy()

Explicitly releases resources used by the component.

voidprepare()

Prepares a class object that implements the Recognizer interface to speech recognition.

voidstartRecording()

Starts the recognition process.

voidstopRecording()

Aborts audio recording.

Method Detail

cancel

public void cancel ()

Cancels the recognition request.

This method cancels the recognition request at any stage of the operation. Audio stops being recorded, and the network connection is terminated if necessary. The method cancels the request synchronously. After calling it, the RecognizerListener interface methods are no longer called.
Note.

If Recognizer is required only while Activity is running, don't forget to stop it using the onPause() method of the Activity system class.

destroy

public void destroy ()

Explicitly releases resources used by the component.

Once the resources are released, no correct operation of Recognizer is possible.

prepare

public void prepare ()

Prepares a class object that implements the Recognizer interface to speech recognition.

Prepares for speech recognition in advance. If the method is not called explicitly, it is called automatically in the startRecording() method. Asynchronous execution.
Note.

We recommend that you call this method before running an object of the class that implements the Recognizer interface.

startRecording

public void startRecording ()

Starts the recognition process.

The method can be called multiple times for the same object of the class. The method runs asynchronously, the onrecordingbegin (Recognizer) callback is invoked when recording starts.

stopRecording

public void stopRecording ()

Aborts audio recording.

The method does not cancel the recognition process, it continues until all results are received. In most cases, this method does not need to be called, since the Voice Activity Detector (VAD) automatically detects the end of speech. However, the method may be useful when the VAD is disabled or incorrectly detects the end of speech.
Note.

If Recognizer is required only while Activity is running, don't forget to stop it using the onPause() method of the Activity system class.