gotev / android-speech

Android speech recognition and text to speech made easy
http://gotev.github.io/android-speech/
Apache License 2.0
473 stars 156 forks source link

Tracking if user speaking or finished #70

Closed xml2208 closed 3 months ago

xml2208 commented 3 months ago

hi, Is there any way to track the user speaking?/ I need to know the whether he/she finished speaking.

gotev commented 3 months ago

Yes, by passing a SpeechProgressView when you start listening. The ProgressView's onEndOfSpeech method will be called by the speech engine.

xml2208 commented 3 months ago

Thanks, @gotev but how to use BaseSpeechRecognitionEngine?

gotev commented 3 months ago

That's only meant to be subclassed to support more speech engines. For your use case simply invoke this method to start listening: https://github.com/gotev/android-speech/blob/1352d77ecdb757164f83e51797827fb445d5be25/speech/src/main/java/net/gotev/speech/Speech.java#L145 passing the SpeechProgressView. You can subclass it if you need further customization.