Emic 2 Text-to-Speech / Arduino
readrefuse73
Posts: 8
I am having trouble "Stoping" playback and unfortunately for me there seems to be very little documentation via a google search.
I downloaded a basic Arduino sketch which worked perfectly.
http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/30016-Emic2-Arduino.zip
The text is sent to the serial port like this:
emicSerial.print('S');
emicSerial.print("This is button number two!");
emicSerial.print('\n');
According to the PDF specifications 'X' is supposed to "Stop playback (while message is playing)".
http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/30016-Emic2TextToSpeech-v1.0.pdf
The PDF also states "Each command must be terminated with a CR or LF."
QUESTIONS:
1. I don't know the Arduino equivalent of "CR" or "LF"
I tried:
emicSerial.print('X');
emicSerial.print('\n');
but this didn't work.
I also tried:
emicSerial.print('\r');
emicSerial.print('\cr');
emicSerial.print('\l');
Any help would be greatly appreciated.
I downloaded a basic Arduino sketch which worked perfectly.
http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/30016-Emic2-Arduino.zip
The text is sent to the serial port like this:
emicSerial.print('S');
emicSerial.print("This is button number two!");
emicSerial.print('\n');
According to the PDF specifications 'X' is supposed to "Stop playback (while message is playing)".
http://www.parallax.com/Portals/0/Downloads/docs/prod/sens/30016-Emic2TextToSpeech-v1.0.pdf
The PDF also states "Each command must be terminated with a CR or LF."
QUESTIONS:
1. I don't know the Arduino equivalent of "CR" or "LF"
I tried:
emicSerial.print('X');
emicSerial.print('\n');
but this didn't work.
I also tried:
emicSerial.print('\r');
emicSerial.print('\cr');
emicSerial.print('\l');
Any help would be greatly appreciated.
Comments
I am making the program on a Mac (No I am not a Mac addict).
The desired affect is that when when I pressed my button attached to pin#3 that the text-to-speech will stop.
Based on the PDF specification sheet (linked above), it states that by sending 'X' + 'CR' or 'LR' The Emic will... "Stop playback (while message is playing)".
I put a tracer inside the button attached to pin#3 to see when it was pressed but the button isn't even isn't recognized until after text-to-speech has finished.
It seemed to me that I could interrupt the software serial by sending 'X' but it doesn't seem to work that way. I can't figure out how to stop playback while Emic is speaking.
It's 8:20 Here in Sweden. Time to get dome diner and get some sleep!
Thanks very much for your input. Greatly appreciated!
just to reiterate. I have three buttons with three different spoken text strings. My intention is to be able to interrupt any button speaking if another button is pressed. Here is all of the code:
I tried to start the speech and I to interrupt it after a short delay before it was finished.
In the PDF documentation is says "X" + "CR" or "LF" will Stop playback while message is playing.
But I think the specification sheet is wrong?
I don't think it is possible to actually interrupt it while it is speaking.
Does anyone one know if it is possible to interrupt Emic While it is speaking?
Yes, it is possible to stop or pause the Emic 2 while speaking. This is demonstrated in my Emic 2-to-Elmo code in the Example section on my site:
http://www.grandideastudio.com/portfolio/emic-2-text-to-speech-module/
The code is written for the PIC12F675, but you should be able to get a general understanding of how it works. Here's a snippet:
The "stop" and "pause" features are also demonstrated at the 3:50 mark of the following video:
http://www.youtube.com/watch?v=Ot1MgBch0MA
You shouldn't need a CR after the X (stop) and Z (pause) commands as you can see from the video. But, I use them in my Emic 2-to-Elmo code and it functions fine.
I don't have much Arduino experience (besides writing the example code for the Emic 2). To test your system, here's a modified version of your code. Note that Emic 2 requires a hard stop (such as a '.') after the text. Also, you had print('X\r') which should use double quotes instead of single.
Have fun!
Joe
I tried the code but I can't seem to figure out how to "stop" the play.
Maybe this is an Arduino problem. I am a student. I don't have a lot of experience with serial communication so I will try and get some help form the faculty on Monday.
Thanks again for your input.
Joe we tried your code but it didn't work.
Despite sending the "stop" via the emicSerial it is impossible to interrupt it.
One of the guys here tried a more sophisticated test. He built a sketch starting the audio durring the set-up.
A button is coded to "stop" the playback but the button is never registered until after emic finishes speaking.
Just so you know, we were using an Arduino Uno board. The Arduino sketch was compiled on Linux, Mac and Windows. None of them worked.
Of course we may have overlooked something at this point it doesn't seem like there is a practical solution.
Check it, http://forums.parallax.com/discussion/150699/emic-arduino-problems-solutions-bohemian-rhapsody
Take a look at the PrintEmicNoWait function and used in the first section of void loop() shown under //Stop Demo