|
|
|
|
Have HAL respond with random phrases or wav files. One of the coolest features in HAL is the ability to play a wav file or speak a phrase when something happens in the house. Unfortunately, HAL can only play the same thing over and over making HAL seem pretty unintelligent. I developed a small application that will allow HAL to play a random phrase or wave file from a list of many, based on an event of your choice. For example, you can use RandomSpeak to have HAL respond differently each time you get his attention. Or you can have HAL respond with a different (random) greeting when you come home. You can have HAL speak up to 999 different random responses for up to 999 different events (groups).
Installation
Place the 2 files in any folder on the HAL computer. All of the text files must be in the same folder as the RandomSpeak.exe. RandomSpeak.exe – This is the application that HAL runs. RandomSpeak.txt – This is the text file you will edit to add all of the possible responses for all groups.
For each group you create you must create an output file that HAL will read for that specific group. Speak001.txt – This is the output file that changes each time. – Have HAL read this file. Speak002.txt – This is the output file that changes each time. – Have HAL read this file. Speak003.txt – This is the output file that changes each time. – Have HAL read this file. … .. . Speak.txt – This is an output file which holds the last created text string and is not dependant on the group number. This should not be used with HAL and is for reference only.
How it works When called from HAL, RandomSpeak.exe will search the text file “RandomSpeak.txt” and randomly select a text phrase (from the specified group). This text phrase will then be output to the text file “SpeakXXX.txt” (where XXX = the group number). HAL can then speak this text file. You must specify the 3-digit group number in the command line argument when running the RandomSpeak executable. For Example: C:\RandomSpeak.exe 001 Modify the included “RandomSpeak.txt” file to your likening. Be sure to keep the same formatting using a 3 digit group number followed by the PIPE “|” delimiter. Also make sure “word wrap” is turned off in the format menu if you are using windows notepad to edit the file.
Important Note: Do not use group number 000 in the “RandomSpeak.txt” file itself. The command number 000 will conveniently build all of the output text files at one time. You can use this capability for 2 purposes:
So before you define the TTS files in HAL get your “RandomSpeak.txt” file started and then run “C:\RandomSpeak.exe 000” from the windows “RUN” menu. This will create all the supporting text files.
Wave file support RandomSpeak can also play random wav files. Simply define the full path to the wave file as in the example below. Copy and paste from windows so you have the exact path correctly. I don’t have any error handling in RandomSpeak. If the last 4 characters of the text are “.wav” then RandomSpeak will randomly play the wave file. You can mix wave files and TTS (Text to Speech) in any of the groups. When a wave file is played HAL also creates the text file (SpeakXXX.txt) with a blank space so HAL will only play the wave and not say the last TTS response. NOTE: RandomSpeak will play the wave file on your computers default (primary) sound card.
Setting up HAL In order to get HAL to speak a different attention response phrase, you must first turn off the automatic response by selecting NONE under system settingsà Personal Assistantà Attention word response.
Now you must create a new rule that will execute each time HAL is addressed.
Be sure to specify the 3 digit group number in the command line argument. This tells the RandomSpeak application which group to select from the text file.
Apply this same technique to allow HAL to respond randomly in any macro or rule.
|