RecognizerActivity class

ru.yandex.speechkit.gui

java.lang.Object ⇽ android.content.Context ⇽ android.content.ContextWrapper ⇽ android.view.ContextThemeWrapper ⇽ android.app.Activity ⇽ android.support.v4.app.FragmentActivity ⇽ RecognizerActivity

public  class  RecognizerActivity  extends android.support.v4.app.FragmentActivity

Ready Activity for speech recognition.

RecognizerActivity makes it easier to embed speech recognition in an app. RecognizerActivity manages the entire recognition process including the user interface for speech recognition, manages the underlying Recognizer and Initializer objects, and so on.

RecognizerActivity is activated by passing speech recognition parameters (RecognizerActivity.EXTRA_LANGUAGE and RecognizerActivity.EXTRA_MODEL) via a firing Intent.

When recognition is complete, the resulting Intent returns RecognizerActivity.RESULT_OK or RecognizerActivity.RESULT_ERROR. The string with the result is contained in RecognizerActivity.EXTRA_RESULT, and an error message is contained in RecognizerActivity.EXTRA_ERROR.

Note.

You must use SpeechKit.configure() to initialize SpeechKit before instantiating the first recognizer.

Fields

StringEXTRA_ERROR

Name of the field (in the resulting Intent) that indicates an error.

StringEXTRA_LANGUAGE

Name of the field (in the firing Intent) that indicates the language.

StringEXTRA_MODEL

Name of the field (in the firing Intent) that indicates the model.

StringEXTRA_RESULT

Name of the field (in the resulting Intent) for returning the result.

StringEXTRA_SHOW_PARTIAL_RESULTS

Name of the field (in the resulting Intent) where a Boolean flag is set for whether to show intermediate versions of the recognition result.

StringEXTRA_SHOW_RESULTS_LIST

Name of the field (in the firing Intent) that specifies a Boolean flag for showing the list of recognition variants (true — show the entire list of hypotheses, false — only show the normalized best hypothesis).

intRESULT_ERROR

Indicates that the recognition process failed with an error.

intRESULT_OK

Indicates that the recognition process completed successfully.

Field descriptions

EXTRA_ERROR

public static final String EXTRA_ERROR ()

Name of the field (in the resulting Intent) that indicates an error.

EXTRA_LANGUAGE

public static final String EXTRA_LANGUAGE ()

Name of the field (in the firing Intent) that indicates the language.

EXTRA_MODEL

public static final String EXTRA_MODEL ()

Name of the field (in the firing Intent) that indicates the model.

EXTRA_RESULT

public static final String EXTRA_RESULT ()

Name of the field (in the resulting Intent) for returning the result.

EXTRA_SHOW_PARTIAL_RESULTS

public static final String EXTRA_SHOW_PARTIAL_RESULTS ()

Name of the field (in the resulting Intent) where a Boolean flag is set for whether to show intermediate versions of the recognition result.

EXTRA_SHOW_RESULTS_LIST

public static final String EXTRA_SHOW_RESULTS_LIST ()

Name of the field (in the firing Intent) that specifies a Boolean flag for showing the list of recognition variants (true — show the entire list of hypotheses, false — only show the normalized best hypothesis).

RESULT_ERROR

public static final int RESULT_ERROR ()

Indicates that the recognition process failed with an error.

RESULT_OK

public static final int RESULT_OK ()

Indicates that the recognition process completed successfully.