Shop OBEX P1 Docs P2 Docs Learn Events
Text to Speech Question — Parallax Forums

Text to Speech Question

KaiyaKaiya Posts: 1
edited 2007-02-09 21:25 in Learn with BlocklyProp
Does anyone know if it is possible to use the Text to Speech module to read a stored number ( like, say, oh- coordinates from the GPS module).

Could it read that stored number, will it blank out entirely or would it read whatever label I'd used for that particular value?

If it is possible, how would you recommend going about it?

Comments

  • Mike GreenMike Green Posts: 23,101
    edited 2007-02-09 04:25
    The Text to Speech module will not read a stored number. There's a "how to use it" type document that you can download if you don't have it already. It includes some examples. You have to convert the number to a sequence of words that the module will say. For example,
    serout tx,baud,[noparse][[/noparse]"say=one;"]
    serout tx,baud,[noparse][[/noparse]"say=thirty;"]
    
    


    You'll have to write code to interpret the coordinates from the GPS module and transmit the appropriate sequence of words. Read the E-Mic documentation and understand the sample program(s). It should be quite doable.
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2007-02-09 17:31
    Another option is to use the DEC formatter for the numeric variable to cause it to be sent as an ASCII string to the Emic.
    SEROUT Tx, Baud, [noparse][[/noparse]Say, "Speed is ", DEC speed, "MPH", EOM]
    

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage
    Parallax Tech Support


    Post Edited (Chris Savage (Parallax)) : 2/9/2007 5:35:31 PM GMT
  • Michael O'DoulMichael O'Doul Posts: 19
    edited 2007-02-09 20:38
    I've done what Chris suggests in several projects. It works great. Good luck.

    michael odoul
  • Michael O'DoulMichael O'Doul Posts: 19
    edited 2007-02-09 21:25
    Oh, just don't forget the leading and trailing spaces in the text that surrounds the variable. If you don't include them, you don't get word separation between the text and variable. Remember that the Emic has a 128 byte buffer that accumulates exactly what you put into it. If you put in [noparse][[/noparse]say,"this is number",$09,eom), it sees "$00this is number$09$aa". $00 and $aa are command codes that direct the emics actions. The rest is the data that the emic acts upon, and it can't tell where text ends and variable starts.

    good luck

    michael odoul
Sign In or Register to comment.