IT. Expert System.

Android Reference

SpeechRecognizer


android.speech

Class SpeechRecognizer



  • public class SpeechRecognizer
    extends Object
    This class provides access to the speech recognition service. This service allows access to the speech recognizer. Do not instantiate this class directly, instead, call createSpeechRecognizer(Context). This class's methods must be invoked only from the main application thread. Please note that the application must have android.Manifest.permission#RECORD_AUDIO permission to use this class.
    • Method Detail

      • isRecognitionAvailable

        public static boolean isRecognitionAvailable(Context context)
        Checks whether a speech recognition service is available on the system. If this method returns false, createSpeechRecognizer(Context) will fail.
        Parameters:
        context - with which SpeechRecognizer will be created
        Returns:
        true if recognition is available, false otherwise
      • createSpeechRecognizer

        public static SpeechRecognizer createSpeechRecognizer(Context context)
        Factory method to create a new SpeechRecognizer. Please note that setRecognitionListener(RecognitionListener) should be called before dispatching any command to the created SpeechRecognizer, otherwise no notifications will be received.
        Parameters:
        context - in which to create SpeechRecognizer
        Returns:
        a new SpeechRecognizer
      • createSpeechRecognizer

        public static SpeechRecognizer createSpeechRecognizer(Context context,
                                              ComponentName serviceComponent)
        Factory method to create a new SpeechRecognizer. Please note that setRecognitionListener(RecognitionListener) should be called before dispatching any command to the created SpeechRecognizer, otherwise no notifications will be received. Use this version of the method to specify a specific service to direct this SpeechRecognizer to. Normally you would not use this; use createSpeechRecognizer(Context) instead to use the system default recognition service.
        Parameters:
        context - in which to create SpeechRecognizer
        serviceComponent - the ComponentName of a specific service to direct this SpeechRecognizer to
        Returns:
        a new SpeechRecognizer
      • setRecognitionListener

        public void setRecognitionListener(RecognitionListener listener)
        Sets the listener that will receive all the callbacks. The previous unfinished commands will be executed with the old listener, while any following command will be executed with the new listener.
        Parameters:
        listener - listener that will receive all the callbacks from the created SpeechRecognizer, this must not be null.
      • startListening

        public void startListening(Intent recognizerIntent)
        Starts listening for speech. Please note that setRecognitionListener(RecognitionListener) should be called beforehand, otherwise no notifications will be received.
        Parameters:
        recognizerIntent - contains parameters for the recognition to be performed. The intent may also contain optional extras, see RecognizerIntent. If these values are not set explicitly, default values will be used by the recognizer.
      • stopListening

        public void stopListening()
        Stops listening for speech. Speech captured so far will be recognized as if the user had stopped speaking at this point. Note that in the default case, this does not need to be called, as the speech endpointer will automatically stop the recognizer listening when it determines speech has completed. However, you can manipulate endpointer parameters directly using the intent extras defined in RecognizerIntent, in which case you may sometimes want to manually call this method to stop listening sooner. Please note that setRecognitionListener(RecognitionListener) should be called beforehand, otherwise no notifications will be received.
      • destroy

        public void destroy()
        Destroys the SpeechRecognizer object.


Content

Android Reference

Java basics

Java Enterprise Edition (EE)

Java Standard Edition (SE)

SQL

HTML

PHP

CSS

Java Script

MYSQL

JQUERY

VBS

REGEX

C

C++

C#

Design patterns

RFC (standard status)

RFC (proposed standard status)

RFC (draft standard status)

RFC (informational status)

RFC (experimental status)

RFC (best current practice status)

RFC (historic status)

RFC (unknown status)

IT dictionary

License.
All information of this service is derived from the free sources and is provided solely in the form of quotations. This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 1300 / 158858363. Delta: 0.03780 с