TTS - TextToSpeech and SAPI

Started by Rolf Brandt, May 04, 2012, 05:17:16 AM

Previous topic - Next topic

Rolf Brandt

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
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Jim Dunn

Just change:

LET oSp = NEW DISPATCH IN "SAPI.SpVoice"

to:

LET oSp = NEWCOM "SAPI.SpVoice"

and it will run in PB10.  : )
3.14159265358979323846264338327950
"Ok, yes... I like pie... um, I meant, pi."

Rolf Brandt

Thanks Jim, I had tried that to, but it did not work.

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

José Roca

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.")


Rolf Brandt

I must correct myself - It does run in PB10. But I do net get it to run in FF3 with PB10.

Any ideas?

Rolf
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Rolf Brandt

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
Rolf Brandt
http://www.rbsoft.eu
http://www.taxifreeware.com
I cook with wine, sometimes I even add it to the food.
(W. C. Fields)

Elias Montoya


How do you get it to speak in spanish?
Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

José Roca

I guess that installing an Spanish voice and selecting it.

Elias Montoya


It's installed. But how do you select it programatically?
Win7, iMac x64 Retina display 5K, i7-5820K 4.4 ghz, 32GB RAM, All updates applied. - Firefly 3.70.

Theo Gottwald

Jose has wrappers for this in his includes for SAPI.

Welcome back, Elias!