Shop OBEX P1 Docs P2 Docs Learn Events
EMIC — Parallax Forums

EMIC

NewzedNewzed Posts: 2,503
edited 2004-11-12 03:48 in BASIC Stamp
How come - I say, how come, if I tell EMIC

date = 24
serout tx, baud, [noparse][[/noparse]Say "Today is", dec date, "July", eom]

It responds with

"Today is two four July"

instead of

"Today is twenty-four July"

Sid

Comments

  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-24 17:46
    You need to add some spaces, otherwise the strings get concatenated and the Emic does it's best to interpret your input. I just verified that this line of code works the way you want it to:

    SEROUT Tx, Baud, [noparse][[/noparse]Say, "Today is ", DEC date, " July", EOM]

    Notice the spaces after "is" and before "July."·· By the way, 25 July is my birthday....

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-07-24 18:36
    Behold - it worketh.

    Happy Birthday, Jon.· I hope our beautiful friend is there to celebrate it with you.

    Sidjumpin.gif
  • NewzedNewzed Posts: 2,503
    edited 2004-07-24 19:58
    I found that if I write:

    hours = $15

    mins = $30

    serout tx, baud, [noparse][[/noparse]say, "The time is ", hex2 hours, ":", hex2 mins, EOM]

    the EMIC translation is perfect.· That solves a lot of problems.hop.gif



  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-24 20:15
    That should work properly, because using HEX2 on the value $15 sends the characters "1" then "5" which, together, are properly interpreted by the Emic speech module as fifteen. The key when using the Emic module is understanding what you're sending to it. When all else fails, write a little test program that works, then work your formatting from there.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-07-24 23:03
    Is there any way to force a pause between words for "dramatic" effect?
    I've tried inserting "· " in the EMIC statements but that doesn't do anything.

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-07-24 23:32
    Try inserting a comma.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • Chris SavageChris Savage Parallax Engineering Posts: 14,406
    edited 2004-07-25 15:09
    As a side-note...Our company will be using the Emic in our new Alarm System, which is based on the BS2P40.· You can view this project here:

    http://www.lightlink.com/dream/chris/alarmsystem.htm


    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Chris Savage

    Knight Designs
    324 West Main Street
    P.O. Box 97
    Montour Falls, NY 14865
    (607) 535-6777
  • southernbobsouthernbob Posts: 34
    edited 2004-07-25 21:23
    For your info, birthdays show up on the calendar function. I guess you probably
    have to enter the date in your profile (not done by magic).
    Bob

    Happy Birthday, Jon
  • NewzedNewzed Posts: 2,503
    edited 2004-08-01 15:34
    I have a small problem with the EMIC, which just showed up today, today being the first of August.

    If the date was the 18th or 24th she would say the date correctly.· Today, however, instead of saying "Today is the first of August", she says "Today is the oh one of· August".· How can I get her to day the "first" or the "Second" and so on.· I could do it with if-then loops but that consumes a lot of code space.· I thought perhaps I could add an abbreviation so the she would say· "first" when $01 appeared,·and "second" when $02 appeared.· The problem with that is that I can not figure out to access the list of abbreviations or to add an abbreviation.· I wrote

    serout Tx, baud, [noparse][[/noparse]listabbrev, EOM]

    and then serout Tx, baud, [noparse][[/noparse]$06, EOM

    and the EMIC flashed red briefly but nothing appeared on the screen.· I tried serouting "say, listabbr, EOM" and "say, $06, EOM" but nothing happened.

    What am I not doing correctly?

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-01 16:12
    You're going to have to write code to do that -- the speech engine inside the Emic is smart enough to pronounce your text as English speech, but certainly not smart enough to know that you want "01" to be said as "First." If "01" appears at the end of a time string, like "12:01" you would certainly want it to say "twelve oh one."

    There is no simple answer for this one; you're going to have to write some code.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office


    Post Edited (Jon Williams) : 8/1/2004 4:21:17 PM GMT
  • NewzedNewzed Posts: 2,503
    edited 2004-08-01 16:12
    I just read Jon Williams' N&V column on the EMIC.· It tells me quite clearly how to add an abbreviation but I am reluctant to add anything until I am able to see what is already there, which I have not been able to do.· Another question, how much space is available for storing abbreviations?

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-01 16:23
    Pages 13 and 14 of the documentation list the standard abbreviations, and spells out that there is 2K of flash space for them.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
  • NewzedNewzed Posts: 2,503
    edited 2004-08-01 17:11
    OK - I solved the $01.first problem with an if/then.· I had to disable the routines for set_volume, set_speed and set_pitch to make room for the extra code, but that's no problem.· They are set where I want them and if I ever need to change them I can do it in the Hard_reset and Soft-reset routines.

    That leaves the problem of why can I not display the list of abbreviations.· I know what they are from the documentation but I would still like to be able to list them.



    This brings up one more question.· If I want to use the abbreviation for August would I write:

    serout Tx, baud, [noparse][[/noparse]say "This is the month of Aug ", useabbr, EOM]

    Sid
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-08-01 18:29
    To list the abbreviations from the Emic requires a terminal connection -- it's not practical to capture with the BASIC Stamp. You may have noticed that the pinout of the Emic TTS matches the QV306 boards -- this is deliberate and allows one to experiment with the Emic TTS using a terminal program and the Quadravox QV430 programming board. To use the Emic in the QV430, set both Emic switches to on (this forces a text interface, and echoes characters). Remove the baud jumpers on the QV430, connect an 8-ohm speaker, power, and your computer, then use HyperTerminal to do the experimenting.

    Text mode commands are covered in the docs, but generally it would look like this:

    · say="The BASIC Stamp really rocks!"<CR>

    You'll hear the Emic speak, then print "OK" on the terminal. To list the stored abbreviations, you would enter this:

    · listabbr<CR>

    When using abbreviations, you don't have to do anything special -- just embed them into your stream:

    · SEROUT TX, Baud, [noparse][[/noparse]Say, "Today is Aug first.", EOM]

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office


    Post Edited (Jon Williams) : 8/1/2004 6:35:26 PM GMT
  • NewzedNewzed Posts: 2,503
    edited 2004-11-11 23:21
    When she says "one" there is no change in the inflection.· She always sounds like something should be following the "one".· Is there anyway to put a downward inflection on this word so when she says "fourteen oh one" it will sounds like a completed statement.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Sid Weaver
    New Combo LCD Backpack

    http://hometown.aol.com/newzed/index.html
    ·
  • Jon WilliamsJon Williams Posts: 6,491
    edited 2004-11-12 03:48
    You would have to insert a custom word with the inflection control.

    ▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
    Jon Williams
    Applications Engineer, Parallax
    Dallas Office
Sign In or Register to comment.