just-ai / aimybox-android-assistant

Embeddable custom voice assistant for Android applications
https://aimybox.com
Apache License 2.0
241 stars 52 forks source link

The mic button dosen't work !! #52

Closed mellahysf closed 4 years ago

mellahysf commented 4 years ago

Hi, I want to run the demo, but both in a device and emulator (in android studio), when I click on the mic button, it doesn't work !! When I click on the mic button, it cancels quickly and I can't send the speech.

Thank you for your help !

Below the trace given to me in the android studio :

I/Aimybox(Aimybox-Components): [main] STANDBY I/Aimybox(STT): [DefaultDispatcher-worker-4] Begin recognition I/Aimybox(Aimybox-Components): [main] LISTENING E/Aimybox(STT): [DefaultDispatcher-worker-3] Failed to get recognition result com.justai.aimybox.speechkit.google.platform.GooglePlatformSpeechToTextException: Exception [3]: Audio recording error. at com.justai.aimybox.speechkit.google.platform.GooglePlatformSpeechToText$createRecognitionListener$1.onError(GooglePlatformSpeechToText.kt:77) at android.speech.SpeechRecognizer$InternalListener$1.handleMessage(SpeechRecognizer.java:450) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) E/Aimybox(Aimybox-Components): [main] com.justai.aimybox.speechkit.google.platform.GooglePlatformSpeechToTextException: Exception [3]: Audio recording error. at com.justai.aimybox.speechkit.google.platform.GooglePlatformSpeechToText$createRecognitionListener$1.onError(GooglePlatformSpeechToText.kt:77) at android.speech.SpeechRecognizer$InternalListener$1.handleMessage(SpeechRecognizer.java:450) at android.os.Handler.dispatchMessage(Handler.java:107) at android.os.Looper.loop(Looper.java:214) at android.app.ActivityThread.main(ActivityThread.java:7356) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:492) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:930) I/Aimybox(Aimybox-Components): [main] STANDBY

mellahysf commented 4 years ago

now It works fine in my device but doesn't in emulator android studio

mellahysf commented 4 years ago

And now it works also in the emulator. Some configurations were required at the emulator to allow access to the network and microphone.