0

I try to use speech to text on android. I write a simple code and try on two devices(Huawei Android 6 api-level 23, Samsung Android 6 api-level 23).

My example is taken from this link

Permissions taken from user on runtime :

<uses-permission android:name="android.permission.RECORD_AUDIO"/>
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>

There many different behaviour between two devices. Huawei device calls onError callback on silence after 5 seconds. But on samsung device, it doesn't call onError in silence. Also it doesn't call onEndOfSpeech.So I try to terminate the recognizer. If I stop manually using recognizer.stoplistening();, it calls onError many times.

Is there any wrong settings in this example? How can I develop more stable app for speech to text?

1 Answers1

0

Speech Recognizer has a very particular behavior, maybe samsung detects detects more noise with its microphone than the huawei. SpeechReconizer decide for itself when you have finished speaking to finalize listening and the setting to modify the silent time does not work. Its a bug from 2011 and google did not want to repair it.

Daniel RL
  • 353
  • 1
  • 12
  • Yes silent time doesn't work.Also onRmsChanged triggers continuously. There are many issues about speechrecognizer. –  Jul 04 '17 at 10:39