Asked — Edited

Randomizing Answers In Speech Recognition

User-inserted image

Hey there! This is a little demo project I made which demonstrates how to make your robot give unique answers to questions.

Example previously posted in this thread: synthiam.com/Community/Questions/8307

This tutorial is in multiple parts: -Installation -Usage -How it works -How to expand

Installation Here is how to install the example. It has extra files which it must reference according the the location stated in the scripts.

Make sure it downloads to your "Downloads" Folder. Then extract the files by right-clicking the "AI voice files.zip" and clicking extract, then okay on the following prompt, if one shows.

Open the extracted folder and click the "Ai integrated 1.ezb" file.

In the ARC project, edit each script in the Script manager to match each file location to the downloads folder, with your computer username.

Download link: AIvoicefiles.zip

Usage When using this project, saying one of the programmed phrases will provoke the computer to respond with a phrase. The phrase of which, is taken from a text file with many phrases on it. Every time you say the predetermined phrase, the computer responds with something different.

How it Works This system works by taking a phrase from a text file. If I say:

Quote:

You look nice today
The computer, using the FileReadRandom() command, opens the complements.txt text file and reads a random line from that file. That file is full of complements, one on each line. Because the script sets a variable as what the computer read, you then use either the "Sayezb()" or "say()" commands to read that variable, which in turn responds to your statement with a complement.

The same process occurs if you greet the robot, but uses a different text file and a different variable.

How to Expand This system is cool, in that it isn't difficult to make, and is pretty much as "cookie cutter" as you can get. What one script does is pretty much the same for every other, other than the different reference file and variable.

So, this means you can make your own randomized answers. All you have to do is make a text file in that same folder you downloaded(after extraction) and enter as many different responses as you want. Then copy one of the example scripts, change the file location to that of the file you just made, and change the variable to something unique and not yet used.


Feel free to redistribute my example file with instructions posted in this thread, just maybe drop an attribution of sorts, AKA my forum name with link to my profile or this thread.

If problems arise, I will update this thread and/or the file, which would require a redownload. I will make sure to put version numbers so you don't loose your progress.

This project does not make it possible for your computer/robot to understand what you say, like a speech interpreter. See this thread for more info: synthiam.com/Community/Questions/8307

Thanks for reading, I hope this helps someone, and that everyone has a good day.


Tech


ARC Pro

Upgrade to ARC Pro

Elevate your robot's capabilities to the next level with Synthiam ARC Pro, unlocking a world of possibilities in robot programming.

#2  

Alright! I was curious where the tutorials ability went...