How Can I Implement Google Voice Typing In My Application?

前端 未结 4 2153
梦毁少年i
梦毁少年i 2021-02-14 05:19

I am trying to add a button in my application that starts Google Voice Typing (or the default speech recognition). I have tried following this tutorial. This tutorial is incredi

4条回答
  •  一向
    一向 (楼主)
    2021-02-14 06:06

    Voice recognition samples are found where you have the android SDK..

    example:

    $ find $SDK_ROOT/samples -name *recogni*
    
    
    ./android-19/legacy/VoiceRecognitionService/res/xml/recognizer.xml
    ./android-19/legacy/VoiceRecognitionService/src/com/example/android/voicerecognitionservice
    ./android-19/legacy/ApiDemos/res/layout/voice_recognition.xml
    ./android-18/legacy/VoiceRecognitionService/res/xml/recognizer.xml
    ./android-18/legacy/VoiceRecognitionService/src/com/example/android/voicerecognitionservice
    ./android-18/legacy/ApiDemos/res/layout/voice_recognition.xml
    ./android-21/legacy/VoiceRecognitionService/res/xml/recognizer.xml
    ./android-21/legacy/VoiceRecognitionService/src/com/example/android/voicerecognitionservice
    ./android-21/legacy/ApiDemos/res/layout/voice_recognition.xml
    

    any one of the services should help show how to do a RecognizerIntent

    The "APIDemo" seems to include use of a RecognizerIntent. check the source for that one. Otherwise look into the services and carve them up into an intent.

提交回复
热议问题