Microsoft voices don't like JavaScript loops?

  • 10 Replies
  • 6836 Views
*

GT40

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1056
    • My Bots
Microsoft voices don't like JavaScript loops?
« on: April 08, 2007, 01:42:28 am »
Hi everyone and Happy Easter. I'm not a programmer and my knowledge about JavaScript is limited. But I like to experiment little things with my Haptek bots. And I'm obviously very happy when they totally obey their dear botmaster. :)



So I created this basic routine:
------------------------------------------

<script language="JavaScript">
function RandomSentence()
{
tab=new Array;
tab[0]="I am sure you like my eyes.";
tab[1]="Hi my love!";
tab[2]="My sister is stupid.";
tab[3]="PoomPoom Pidoo.";
tab[4]="Don't forget I see you.";
tab[5]="I see what you are doing.";
tab[6]="Hello darling!";
C=Math.floor(7*Math.random());
sentence=tab[C];
A= "('\\q2[ s0=[";
B= "]]')";
SendText(A+sentence+B);
}
</script>

HapToDo_Add_JS(20.0, "RandomSentence();");

------------------------------------------
>>> The bot says a random sentence at t = 20.0 sec.



Then I added a loop:
------------------------------------------

d=5; // sequence duration
n=1000; // loop number
for (i=0; i<=n; i++)
{
HapToDo_Add_JS(i*d+20.0, "RandomSentence();");
}

------------------------------------------
>>> The bot says a random sentence every 5 sec.



And you know what? This script works perfectly with the Lernout & Hauspie voices installed on my PC. But with the Microsoft voices, the bot only says ONE random sentence and then the loop stops.

Is my code wrong? Is my computer (under W98) too old? Is it an anti-Microsoft virus? Or maybe global warming... ???

You can test this script here: RandomSentence Test

Tell me please if it's the same thing with you. Or if you have an explanation. Thanks in advance.
"There is no RL. Only AFK." (Jamie Jervil, resident of Second Life)

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6860
  • Mostly Harmless
Re: Microsoft voices don't like JavaScript loops?
« Reply #1 on: April 08, 2007, 12:19:07 pm »
She only does one sentence for me too, I am using ScanSoft's Karen voice.  I don't know why though, if it works for one voice you would think it should work for others.

*

dan

  • Mechanical Turk
  • *****
  • 170
    • AI
Re: Microsoft voices don't like JavaScript loops?
« Reply #2 on: April 08, 2007, 04:44:41 pm »
Maybe it's a SAPI4 vs SAP5 thing, I've run into differences before.
A computer would deserve to be called intelligent if it could deceive a human into believing that it was human. A.Turing

*

Art

  • At the end of the game, the King and Pawn go into the same box.
  • Trusty Member
  • **********************
  • Colossus
  • *
  • 5865
Re: Microsoft voices don't like JavaScript loops?
« Reply #3 on: April 09, 2007, 10:29:37 am »
Well, I had perfect results when I tried it.
At first it used the MS Sam or Peter I think.
I closed your app window
Ran HaptekSAPI setup and selected another TTS as the computer's default voice.
Clicked on your link again and it spoke with the new voice and a lot of the random phrases.
Closed again, repeat previous steps
Opened app window link and worked the way you designed it...random phrases.
Repeated a 3rd and 4th time
All voices worked fine and all spoke ramdom phrases.

Voices tested were MS Sam, Australia's Karen, Cepstral's Emily, NeoSpeech Kate.
No Problems!

I'm running an AMD 4200+ Dual Core w/2 gigs RAM, 256 meg ATI Diamond graphics card & 300 gig HD on Windows XP - SP2 using IE 6.0.29 as a browser.

There you have it. Good job!
In the world of AI, it's the thought that counts!

*

GT40

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1056
    • My Bots
Re: Microsoft voices don't like JavaScript loops?
« Reply #4 on: April 10, 2007, 12:55:31 am »
Thanks Art and many thanks to all for your tests. :)

You're probably right, dan, it could be a problem with SAPI engines because

- with the SAPI 4 Lernout & Hauspie voices: the loop works.
- with the SAPI 4 Microsoft voices (Mary, Mike, Sam): the loop doesn't work.
- with the SAPI 5 Microsoft voices (Mary, Mike, Sam): the loop works!!!

I remember another example of javascript: when opening a new window with an AIML category, the bot speaks. Or not... Very strange, mysterious and exasperating. >:(

Another good idea could be to change my computer (born during the last century). Thanks for not laughing at my dear PC with an Intel Celeron 400, 128 MB RAM, Windows 98 SE and IE 6.0.

Maybe after 2012, when Vista will become obsolete. ;)
"There is no RL. Only AFK." (Jamie Jervil, resident of Second Life)

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6860
  • Mostly Harmless
Re: Microsoft voices don't like JavaScript loops?
« Reply #5 on: April 11, 2007, 12:38:00 pm »
I think it is just software though and you don't need to change your PC.

I'm running a AMD 3000+ with windows 2000 and she would only speak once with the newer ScanSoft Karen voice, today though she said nothing at all..

With Mary SAPI 4 she said nothing, but with Mary SAPI 5 it works and she says random lines.
« Last Edit: April 11, 2007, 12:43:21 pm by Freddy »

*

GT40

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1056
    • My Bots
Re: Microsoft voices don't like JavaScript loops?
« Reply #6 on: April 12, 2007, 01:02:27 am »
Many thanks for your tests, Freddy. All this is very mysterious.

This evening, I saw a british TV serie: "Murphy's law". I don't believe in coincidences... :)
"There is no RL. Only AFK." (Jamie Jervil, resident of Second Life)

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6860
  • Mostly Harmless
Re: Microsoft voices don't like JavaScript loops?
« Reply #7 on: April 12, 2007, 02:40:58 pm »
Heheh, that show was on here last year, it was pretty good actually.  The main man used to do a lot of light-hearted shows and jokey stuff but suddenly he became this hard man over night.  Good stuff though.

If you need any more testing done just post again :)

I haven't got the link handy, but you should post a link to your other page with the two Haptek characters on it, I think some of the members would be interested in seeing it.

*

GT40

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1056
    • My Bots
Re: Microsoft voices don't like JavaScript loops?
« Reply #8 on: April 13, 2007, 06:02:15 pm »
Thanks for your help offer, Freddy.

Yes. Maybe I could put my "double chatbot" in "General Chat > Experiments & Projects". It might seem a little presumptuous but here, Meghan and Jessica could meet their friends Trinity and Lola. Who feel very alone. :)
"There is no RL. Only AFK." (Jamie Jervil, resident of Second Life)

*

GT40

  • Trusty Member
  • **********
  • Millennium Man
  • *
  • 1056
    • My Bots
Re: Microsoft voices don't like JavaScript loops?
« Reply #9 on: April 22, 2007, 11:13:50 pm »
SHAME ON ME!!!  :-[

I finally changed the two (why so complicated?) following lines:

A= "('\\q2[ s0=[";
B= "]]')";

into:

A= "\\q2[ s0=[";
B= "]]";

(more classical and logical) and now, the loop works correctly with all the voices of my computer, SAPI 4 or 5, Microsoft or not.

I don't want to delete this thread because of your answers. Many thanks and sorry for having wasted your time (sorry Mr. Gates too).

Maybe a new title:

MICROSOFT VOICES DON'T LIKE BAD PROGRAMMERS  ::)
"There is no RL. Only AFK." (Jamie Jervil, resident of Second Life)

*

Freddy

  • Administrator
  • **********************
  • Colossus
  • *
  • 6860
  • Mostly Harmless
Re: Microsoft voices don't like JavaScript loops?
« Reply #10 on: April 23, 2007, 03:01:09 pm »
Ahh speech marks...they often throw me out too...lesson learned  ;D

 


Requirements for functional equivalence to conscious processing?
by DaltonG (General AI Discussion)
November 19, 2024, 11:56:05 am
Will LLMs ever learn what is ... is?
by HS (Future of AI)
November 10, 2024, 06:28:10 pm
Who's the AI?
by frankinstien (Future of AI)
November 04, 2024, 05:45:05 am
Project Acuitas
by WriterOfMinds (General Project Discussion)
October 27, 2024, 09:17:10 pm
Ai improving AI
by infurl (AI Programming)
October 19, 2024, 03:43:29 am
Atronach's Eye
by WriterOfMinds (Home Made Robots)
October 13, 2024, 09:52:42 pm
Running local AI models
by spydaz (AI Programming)
October 07, 2024, 09:00:53 am
Hi IM BAA---AAACK!!
by MagnusWootton (Home Made Robots)
September 16, 2024, 09:49:10 pm
LLaMA2 Meta's chatbot released
by spydaz (AI News )
August 24, 2024, 02:58:36 pm
ollama and llama3
by spydaz (AI News )
August 24, 2024, 02:55:13 pm
AI controlled F-16, for real!
by frankinstien (AI News )
June 15, 2024, 05:40:28 am
Open AI GPT-4o - audio, vision, text combined reasoning
by MikeB (AI News )
May 14, 2024, 05:46:48 am
OpenAI Speech-to-Speech Reasoning Demo
by MikeB (AI News )
March 31, 2024, 01:00:53 pm
Say good-bye to GPUs...
by MikeB (AI News )
March 23, 2024, 09:23:52 am
Google Bard report
by ivan.moony (AI News )
February 14, 2024, 04:42:23 pm
Elon Musk's xAI Grok Chatbot
by MikeB (AI News )
December 11, 2023, 06:26:33 am

Users Online

396 Guests, 0 Users

Most Online Today: 451. Most Online Ever: 2369 (November 21, 2020, 04:08:13 pm)

Articles