Start speech recognition thru voice with phrase like “Ok Google”?

前端 未结 2 1936
执笔经年
执笔经年 2021-02-07 10:53

I\'m building an app that uses Voice Commands to perform certain functions. I got some codes working from here

private static final int SPEECH_REQUEST_CODE = 0;
         


        
相关标签:
2条回答
  • 2021-02-07 11:25

    Continuous Speech recognition with help of Service :-

    Android Speech Recognition as a service on Android 4.1 & 4.2

    GitHub Sample :-

    https://github.com/galrom/ContinuesVoiceRecognition

    Responding to magic words like Ok Google

    https://github.com/cmusphinx/pocketsphinx-android-demo

    I have implemented same feature for Banking Project. I was triggering speech to text recognition on device shake

    0 讨论(0)
  • 2021-02-07 11:44

    You will need to write a service for continuous speech recognition. And based on the inputs you get as speech detect your trigger phrase and take action.

    This may be memory intensive and you will need to optimize by starting and stopping services on appropriate times and screens.

    The accepted answer to this question provides a means to achieve a similar thing.

    0 讨论(0)
提交回复
热议问题