How to use speech recognition / speech detection to trigger an audio source on an Android device

Hello everyone,

I would like to make an Android app in Unity that has speech recognition. For instance, I would say “How are you?” to my Android phone and the app detects this specific sentence and then triggers an audiosource that says “I’m fine, thank you”.

I came across a Unity asset called “Android Native Dialogs and Functions Plugin”. Link: Android Native Dialogs and Functions Plugin | GUI Tools | Unity Asset Store

This asset contains a Speech Recognizer. I opened the example scene of this asset (Path: Assets/FantomPlugin/Demo/Scenes/SpeechRecognizerTest). The image (please see attachment) shows how this app looks like on my phone. If I tap the “Speech here” button, the microphone gets activated and picks up my speech. If I say “how are you”, the app detects my speech and translate it into a text, as seen in the text field.

The next step that I would like to achieve is that this specific written sentence (“how are you”) could somehow serve as a trigger to activate an audiosource as mentioned above. Does anyone know how this can be done?

Late answer maybe. If you got that far to have it recognize your speech, it cannot be hard to implement what should happen if some specific words are spoken. I guess that if you can get hold of the result, you can easily manipulate whatever should happen, that part does not really have anything to do with the actual plugin, I guess. Didn’t know about it, but will check into it!