BS2 to EMIC2 Text to Speech Programming Issue
TheTech69
Posts: 51
in BASIC Stamp
I have used the demo .bs2 files and they work fine. I am trying to use the ASCII command Wx, where x is a value ranging from 75 to 600, to a just the speech rate. I figured I would be able to use the same coding format for volume that was in the demo file.
I have tried the following code snippets that didn't work as expected:
SEROUT EMIC_TX, EmicBaud,["W600"], CR
SERIN EMIC_RX, EmicBaud,[WAIT":"]
OR
SEROUT EMIC_TX, EmicBaud,["W":"600"],CR
SERIN EMIC_RX, EmicBaud,[WAIT":"]
However, the text I have will not play after either snippet.
I posted this in Accessories also.
Thank You for any assistance.
I have tried the following code snippets that didn't work as expected:
SEROUT EMIC_TX, EmicBaud,["W600"], CR
SERIN EMIC_RX, EmicBaud,[WAIT":"]
OR
SEROUT EMIC_TX, EmicBaud,["W":"600"],CR
SERIN EMIC_RX, EmicBaud,[WAIT":"]
However, the text I have will not play after either snippet.
I posted this in Accessories also.
Thank You for any assistance.
Comments
http://forums.parallax.com/discussion/134682/forum-rules-and-guidelines#latest
ok...the following snippet does set the speech rate:
SEROUT EMIC_TX, EmicBaud,["W300", CR]
SERIN EMIC_RX, EmicBaud,[WAIT(":")]
However, the EMIC2 will not play the text I have: "S","Does this sound fast?"
When I change the code to the following:
SEROUT EMIC_TX, EmicBaud,["W:300", CR]
SERIN EMIC_RX, EmicBaud,[WAIT(":")]
the sound will play AND at the speech rate number I assign but only after I reload the program with the change.
So why will it not work all together and play the text after the parameter of the speech rate and volume level has been set?
Quote
Note that the Emic precedes the colon with a CR in every case.
With "S" (Speak) and "V" (Volume), the BS-2 consistently caught the colon.
With "W" (Speaking rate), the BS-2 consistently missed the colon.
With "N" (select Voice), the BS-2 usually, but not always, missed the colon.
As I see it, the only practical solution is to not look for the colon following "W" and "N".
Always make certain your command is perfectly formed and follow it with a little PAUSE if you like insurance.
Thank you for your time to experiment with this for me. Maybe the code will work for you. I have tried without the colon as indicated in the attached code. I have changed the 600 to 75 and then back again multiple times. The text still will not play unless I add the colon and a new number and then F9 (Run) the changed code to the BS2.
It's as if the code for the desired speech rate needs loaded first. Then comment out the speech rate code and reload the code into the BS2.Then the text will convert to the speech and play just fine at the desired speech rate. I haven't tried adding a few milli seconds to see if that works, though. I'll try that when I get a chance.
FOR rate = 100 to 500 step 50
SEROUT txPin, Baud, ["W", rate, CR]
PAUSE 50
SEROUT txPin, Baud, ["S", "whatever string", CR]
SERIN rxPin, Baud, [WAIT, (":")]
NEXT
Thank you for taking the time to assist me with this.
I never even considered NOT using a SERIN command. Is that a double negative? Anyway...
I thought the SERIN had to be there.
tomcrawford, you are correct! I removed the SERIN that I had right after the "W" parameter line and the code works exactly like I wanted it to.
Thank You all!
Parallax added a note in this go-to documentation, but didn't fix the BS-2 examples. They still show the SERIN.