Crashing when using SpeechRecognizer after TextToSpeech

I am creating a Chat Bot to use at a grade school STEM Camp. I am using a SpeechRecognizer component in conjunction with a TextToSpeech component. It is working fine on Android. However, on iOS (on an iPad Mini 5th gen version 14.6), it seems that whenever I use the SpeechRecognizer AFTER using TextToSpeech, AI2 Companion will crash.

I attached a screenshot to show the basic blocks and functionality I am going for. If there is a work-around by arranging the code in a different way, I would be interested to know that.

  • you might reorder the Blocks in the AfterGettingText... this could be a timing issue (OutputLabel of course must precede Speak)
  • you can temporarily change your TTS message to I am testing and don't call the RandomResponse. This allows you to help determine if the issue on iOs is caused by your Procedure or the TTS.
  • you might post your Project aia. Settings made either on the SR or TTS Designer properties might have an effect (your Blocks can't show those as posted). If this is a bug, it will allow our overworked developers to test your code more easily on both an Android and iOS gadget.

Hmm. Thanks for the report. I haven't heard of this happening before but I have an idea of what might be causing it. Would you be willing to share the project with us so we could test against it?

Absolutely! I saved a scaled down version of my project (as I am still working on it and constantly changing it) and attached the AIA. I added another button to call the TextToSpeech for debugging, although in my working version the TextToSpeech is automatic after the user says something. Let me know if you want me to share it in another way.STEMCampChatBot_Test.aia (54.6 KB)

Hmm, I am having the same exact problem. I can do this multiple times on an Android device without any problem, but it crashes on iOS. I have noticed that it works fine the first time around (does everything correctly), but the second time I press the button the use speech recognition, the app crashes. Unlike Google speech on Android, iOS tells me to confirm to start recording and to do the same finish recordings (it is iOS, not the App Inventor). Once finished, it does not work again. Any tips or suggestions?