PlanetSquires Forums

Support Forums => Other Software and Code => Topic started by: Rolf Brandt on May 04, 2012, 05:17:16 AM

Title: TTS - TextToSpeech and SAPI
Post by: Rolf Brandt on May 04, 2012, 05:17:16 AM
Has anyone any experience with TextToSpeech under FF3 and PB10?

It seemed very simple with PB9 (found a beautiful example by Josè).

    LOCAL oSp AS DISPATCH

    LET oSp = NEW DISPATCH IN "SAPI.SpVoice"
    IF ISFALSE ISOBJECT(oSp) THEN EXIT FUNCTION

    LOCAL vRes AS VARIANT
    LOCAL vTxt AS VARIANT
    LOCAL vTime AS VARIANT

    vTxt = "Hello everybody! Are you sitting comfortable? Then please stand up."
    OBJECT CALL oSp.Speak(vTxt) TO vRes
    vTime = -1 AS LONG
    OBJECT CALL oSp.WaitUntilDone(vTime) TO vRes


But I am a little stuck now.


Rolf
Title: Re: TTS - TextToSpeech and SAPI
Post by: Jim Dunn on May 04, 2012, 10:39:29 AM
Just change:

LET oSp = NEW DISPATCH IN "SAPI.SpVoice"

to:

LET oSp = NEWCOM "SAPI.SpVoice"

and it will run in PB10.  : )
Title: Re: TTS - TextToSpeech and SAPI
Post by: Rolf Brandt on May 04, 2012, 10:42:19 AM
Thanks Jim, I had tried that to, but it did not work.

Rolf
Title: Re: TTS - TextToSpeech and SAPI
Post by: José Roca on May 04, 2012, 10:53:22 AM
I have tried it and it works. Alternatively. you can add #INCLUDE "sapi.inc" and use:


SpSpeak("Hello everybody! Are you sitting comfortable? Then please stand up.")

Title: Re: TTS - TextToSpeech and SAPI
Post by: Rolf Brandt on May 04, 2012, 10:55:34 AM
I must correct myself - It does run in PB10. But I do net get it to run in FF3 with PB10.

Any ideas?

Rolf
Title: Re: TTS - TextToSpeech and SAPI
Post by: Rolf Brandt on May 04, 2012, 11:04:57 AM
Thanks Jim and Jose,

don't know why it won't work with Jim's code correction for me. I'll try to investigage.
SpSpeak (with SAPI.INC) works fine.

Rolf
Title: Re: TTS - TextToSpeech and SAPI
Post by: Elias Montoya on May 16, 2012, 07:00:21 PM

How do you get it to speak in spanish?
Title: Re: TTS - TextToSpeech and SAPI
Post by: José Roca on May 16, 2012, 07:27:42 PM
I guess that installing an Spanish voice and selecting it.
Title: Re: TTS - TextToSpeech and SAPI
Post by: Elias Montoya on May 17, 2012, 12:59:56 AM

It's installed. But how do you select it programatically?
Title: Re: TTS - TextToSpeech and SAPI
Post by: Theo Gottwald on May 17, 2012, 05:49:26 AM
Jose has wrappers for this in his includes for SAPI.

Welcome back, Elias!