Shop OBEX P1 Docs P2 Docs Learn Events
BS2 to EMIC2 Text to Speech Programming Issue — Parallax Forums

BS2 to EMIC2 Text to Speech Programming Issue

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.

Comments

  • Take a look at the "changing my voice" part of the BS-2 Demo. Note that the SERIN is commented out because "at 9600 baud, the BS-2 misses the Emic-2's response for commands the respond quickly". Very likely the same issue with the Wx command.
  • PublisonPublison Posts: 12,366
    edited 2015-11-14 23:25
    Your other post has been deleted. It is against forum policies to double post.

    http://forums.parallax.com/discussion/134682/forum-rules-and-guidelines#latest
  • UPDATE:

    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
  • I did some experiments; here are results with the particular BS-2 and Emic that I used:

    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.
  • TheTech69TheTech69 Posts: 51
    edited 2015-11-15 19:18
    tomcrawford,

    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.
  • I was suggesting that you not put a SERIN following a "W" command at all. Just a little pause.

    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

  • I'll have to set up my BS2 Development board on Monday-Tuesday to check this out.
  • I was hoping someone from Parallax tech could set this up before I did. I can't get to it until tomorrow.
  • Publishing and tomcrawford,

    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!
  • I should have been more explicit about to fix the problem in my first response.

    Parallax added a note in this go-to documentation, but didn't fix the BS-2 examples. They still show the SERIN.
Sign In or Register to comment.