How to use Speech Recognizer and Sound Recorder to make recording end with a keyword

Hi there!

We have this app built on Kodular where you press a button (or wait for 3 seconds) to record your speech for 15 seconds, and the speech will get converted to a wav file and sent to Firebase. We got a request from our client that, instead of waiting for the recording to end after 15 seconds, they want the recording to end as soon as they say certain keywords, such as “end” and “finished.”

We’ve been experimenting with Speech Recognizer and Sound Recorder components to accomplish this, but have run into at least two issues:

  1. Speech Recognizer terminates as soon as there is any amount of pause in speech, so by the time I say those keywords, they would not get recognized at all.
  2. While Speech Recognizer is on, Sound Recorder does not get activated (speech is not being recorded) even though I ordered the two components such that Sound Recorder fires before Speech Recognizer. Here is a screenshot of our blocks:
    Screen Shot 2021-05-24 at 8.42.22 PM

Could anyone advise me on how to resolve the two issues? Please let me know if you would like any further information, and thank you for your help in advance!

Sorry. This cannot work. Because the Soundhardware cannot handle this 2 tasks at the same time. This is related to hardware limitations of android phones.