View Full Version : Emic TTS program code

Joe Fishback
11-14-2006, 10:26 AM
I have a Parallax Emic TTS module. I have dowmloaded the manual and sample programs from the Parallax web site. The sample programs run fine and make some nice voices. I have studied the sample program “Emic_TTS.BS2”. I have been able to write some programs of my own that as run OK.
I some questions on why I have to do what I do and if this is the correct syntax.
1. I have to put the “GOSUB Check_Busy” as done in the sample program “Emic_TTS.BS2” after the
SEROUT text command to get the program to run. Why do have do this and it the correct way?
2. I have to put the “GOSUB Wait_OK” as done in the sample program “Emic_TTS.BS2” after the
SEROUT ( Volume, Pitch or Speed) command to get the program to run. Why do have do this and it the correct way?
3 The sample program makes constants for words as Hex. Then you have to set Switch 1 to “off”
·· (Hex mode) . This does not seem to save any typing or understand it any better. Why not just set·······
·· Switch 1 to “on” (ASCII) and just type in the words. Why?
Any help on understanding the Emic syntax would be graetly appreciated

······ Joe Fishback

-Robots are my friends-

Tracy Allen
11-14-2006, 12:58 PM
The busy line is a hardware handshake that tells your program when the EMIC is busy speaking a sentence and cannot accept any input into its speech buffer. The Check_Busy subroutine in the sample program simply waits while that signal line remains high (=YES). This can take some time for a long sentence.

The OK is a software handshake that tells your program that a command has been entered and that the EMIC has recognized and acted upon it. You can't enter a new command until the EMIC is finished with the previous one. The OK usually comes back within a fraction of a second (unless something is wrong).

The sample program does not handle errors gracefully. You might not want your application program to wait forever for the EMIC, nor to simply end the program if it fails to get back an OK.
Instead, you might want a timeout to cause a hard reset for the EMIC, and a try again later.

The HEX syntax is simply a little bit shorter for the Stamp. Instead of sending it the string "say=" the hex command is simply $00, one byte. And the "OK" response from the EMIC is also just one byte, $AA. No big deal, especially if you are tying the commands on a terminal. But in programming it makes constructing the strings a littlle bit easier.

Tracy Allen
www.emesystems.com (http://www.emesystems.com)