Voice Loquendo TTS® Sapi 5 Loquendo TTS

Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby Silvio.Falconi » Tue Apr 09, 2019 1:10 pm

Can we with Fwh run it ?
on windows 10 we have sapi 5
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby cnavarro » Tue Apr 09, 2019 1:15 pm

Search in forum for "SAPI.SpVoice"
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby karinha » Tue Apr 09, 2019 1:42 pm

João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby Silvio.Falconi » Tue Apr 09, 2019 1:45 pm

yes I found it
but

Progetto: test, Ambiente: bcc7Harbor:
[1]:Harbour.Exe test.prg /m /n0 /gc1 /es2 /a /iC:\Work\fwh\include /iC:\work\HARBOUR\Include /jI18n\Main.hil /iinclude;c:\work\fwh\include;C:\work\HARBOUR\include /oObj\test.c
Harbour 3.2.0dev (r1712141320)
Copyright (c) 1999-2016, http://harbour-project.org/
Compiling 'test.prg'...
test.prg(60) Error E0022 Invalid lvalue ':'
test.prg(61) Error E0022 Invalid lvalue ':'
test.prg(62) Error E0022 Invalid lvalue ':'
test.prg(64) Error E0022 Invalid lvalue ':'
test.prg(67) Error E0022 Invalid lvalue ':'
test.prg(68) Error E0022 Invalid lvalue ':'
6 errors

No code generated.
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby karinha » Tue Apr 09, 2019 2:12 pm

Doing right, that will work.

Haciendo cierto, funcionará.

VOICE2.PRG

Code: Select all  Expand view  RUN

#include "FiveWin.ch"

static lIsPaused := .F.

function Main()

   local oDlg, oGetText, oBtnPlay, oBtnPause, oBtnStop, oBtnInterroga, oSbrVolume, oSbrTTSVelocity
   local oBtnVolumeUp, oBtnVolumeDown, oBtnVelocityUp, oBtnVelocityDown
   local oSayVolumeLevel, oSayVelocityLevel
   local nVolume := 50
   local nVelocity := 0
   local oVoice := tOleAuto():New( "Sapi.SPVoice" )
   local oVoiceInfo := tOleAuto():New( "Sapi.SPVoice" )

   // SpeechVoiceFlags
   local SVSFlagsAsync := 1
   local SVSFPurgeBeforeSpeak  := 2
   // SpeechVoiceEvents
   local SVEPhoneme := 64

   local cTextToRead := "La Guía de Programación de FiveWin, ofrece una introducción dirigida a técnicas " + ;
                        "de desarrollo de aplicaciones de Windows utilizando (x)Harbour y FiveWin. Esta guía " + ;
                        "explicará los conceptos básicos que usted debe tener para construir correctamente sus " + ;
                        "aplicaciones de Windows."

   oVoice:AlertBoundary := SVEPhoneme
   oVoice:Volume := nVolume
   oVoice:Rate := nVelocity
   
   DEFINE DIALOG oDlg RESOURCE "sound"

   REDEFINE GET oGetText VAR cTextToRead ID 10 OF oDlg MULTILINE UPDATE
     
   REDEFINE BUTTON oBtnPlay ID 2010 OF oDlg ACTION ( oVoice:Speak( cTextToRead, SVSFlagsAsync ) ) UPDATE
   
   REDEFINE BUTTON oBtnPause ID 2020 OF oDlg ACTION ( PauseResume( oVoice, oDlg, oBtnPause ), oDlg:Update() ) UPDATE
   
   REDEFINE BUTTON oBtnStop ID 2030 OF oDlg ACTION oVoice:Speak( " ",SVSFPurgeBeforeSpeak ) UPDATE
   
   REDEFINE BUTTON oBtnInterroga ID 2040 OF oDlg
   
   REDEFINE SAY oSayVolumeLevel ID 160 OF oDlg UPDATE
   
   oSayVolumeLevel:SetText( Str( nVolume ) )
   
   REDEFINE SAY oSayVelocityLevel ID 170 OF oDlg UPDATE
   
   oSayVelocityLevel:SetText( Str( nVelocity ) )
   
   REDEFINE BUTTON oBtnVolumeUp ID 120 OF oDlg;
            ACTION ( nVolume := nVolume + 10, iif( nVolume > 100, ( nVolume := 100 , MsgInfo( "Máximum Volume" ) ) ,;
            oVoice:Volume := nVolume ), oSayVolumeLevel:SetText( Str( nVolume ) ) ) UPDATE

   REDEFINE BUTTON oBtnVolumeDown ID 130 OF oDlg;
            ACTION ( nVolume := nVolume - 10, iif( nVolume < 0, ( nVolume := 0 , MsgInfo( "Mínimum Volume" ) ),;
            oVoice:Volume := nVolume ), oSayVolumeLevel:SetText( Str( nVolume ) ) ) UPDATE

   REDEFINE BUTTON oBtnVelocityUp ID 140 OF oDlg;
            ACTION ( nVelocity++, iif( nVelocity > 10, ( nVelocity := 10 , MsgInfo( "Máximum Velocity" ) ),;
            oVoice:Rate := nVelocity ), oSayVelocityLevel:SetText( Str( nVelocity ) ) ) UPDATE

   REDEFINE BUTTON oBtnVelocityDown ID 150 OF oDlg;
            ACTION ( nVelocity--, iif( nVelocity < -10, ( nVelocity := -10 , MsgInfo( "Mínimum Velocity" ) ),;
            oVoice:Rate := nVelocity ), oSayVelocityLevel:SetText( Str( nVelocity ) ) ) UPDATE

   ACTIVATE DIALOG oDlg CENTERED

return nil

function PauseResume( oVoice, oDlg, oBtnPause )
   
   iif( lIsPaused,;
      ( oVoice:Resume(), lIsPaused := .F., oBtnPause:SetText( "Pause" ) ),;
      ( oVoice:Pause(), lIsPaused := .T., oBtnPause:SetText( "Resume" ) ) )
   
return nil
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby karinha » Tue Apr 09, 2019 2:13 pm

VOICE2.RC

Code: Select all  Expand view  RUN

#define DIALOG_10   10
#define DIALOG_8   8
#define DIALOG_7   7
#define DIALOG_6   6
#define DIALOG_4   4
#define DIALOG_3   3
#define DIALOG_2   2
#define DIALOG_1   1
#define DIALOG_5   5

sound DIALOG 69, 52, 446, 364
STYLE DS_ABSALIGN | DS_MODALFRAME | WS_POPUP | WS_VISIBLE | WS_CAPTION | WS_SYSMENU
CAPTION "Text To Speech (TTS)"
FONT 8, "MS Sans Serif"
{
 PUSHBUTTON "Play", 2010, 75, 341, 63, 14
 PUSHBUTTON "Pause", 2020, 139, 341, 55, 14
 PUSHBUTTON "Stop", 2030, 195, 341, 63, 14
 PUSHBUTTON "?", 2040, 259, 341, 55, 14
 LTEXT "Texto a Leer:", -1, 5, 14, 48, 10
 EDITTEXT 10, 52, 13, 278, 323, ES_MULTILINE | WS_BORDER | WS_TABSTOP
 LTEXT "Volumen:", -1, 364, 72, 40, 10
 LTEXT "Velocidad:", -1, 402, 72, 37, 10
 PUSHBUTTON "+", 120, 371, 94, 17, 14
 PUSHBUTTON "-", 130, 371, 114, 17, 14
 PUSHBUTTON "+", 140, 409, 94, 17, 14
 PUSHBUTTON "-", 150, 409, 114, 17, 14
 LTEXT "Text", 160, 372, 135, 20, 8
 LTEXT "Text", 170, 410, 135, 20, 8
 LTEXT "Levels:", -1, 335, 135, 35, 10
}
 
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby Silvio.Falconi » Tue Apr 09, 2019 5:53 pm

Now run ok but there are many say not run on rc
How I can make have as resindent on memory and to link it to read each text
sample the use open the office word and the tts speach the menu items..

I need it for a visually impaired student
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby karinha » Tue Apr 09, 2019 6:01 pm

I'm sorry. I do not know. I've never done anything for the visually impaired.

Regards.
João Santos - São Paulo - Brasil - Phone: +55(11)95150-7341
User avatar
karinha
 
Posts: 7872
Joined: Tue Dec 20, 2005 7:36 pm
Location: São Paulo - Brasil

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby cnavarro » Tue Apr 09, 2019 8:12 pm

Silvio.Falconi wrote:Now run ok but there are many say not run on rc
How I can make have as resindent on memory and to link it to read each text
sample the use open the office word and the tts speach the menu items..

I need it for a visually impaired student


Complicated
You have to implement the detection of the control in the mousemove method, among others.
Cristobal Navarro
Hay dos tipos de personas: las que te hacen perder el tiempo y las que te hacen perder la noción del tiempo
El secreto de la felicidad no está en hacer lo que te gusta, sino en que te guste lo que haces
User avatar
cnavarro
 
Posts: 6552
Joined: Wed Feb 15, 2012 8:25 pm
Location: España

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby Silvio.Falconi » Wed Apr 10, 2019 8:40 am

My idea is create a small browser where the student can show web pages and the procedure speeck with tts


II wish set the italian voice
I saw on we there is with VB

set voice = CreateObject("SAPI.SpVoice")
set voice.Voice = voice.GetVoices.Item(1)
voice.Rate = 1
voice.Volume = 90
voice.Speak TextMessage


I tried to set oVoice:= voice.GetVoices.Item(1) but make error
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm

Re: Voice Loquendo TTS® Sapi 5 Loquendo TTS

Postby Silvio.Falconi » Wed Apr 10, 2019 8:49 am

if make
oVoiceInfo:GetVoices:count()

give me 1

ok now I install Speech SDK 5.1 on windows seven because not run ok
on Widows 10 there is native sapi5 and it run ok ( I can listen good and clear all the words )
Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)
I use : FiveWin for Harbour November 2023 - January 2024 - Harbour 3.2.0dev (harbour_bcc770_32_20240309) - Bcc7.70 - xMate ver. 1.15.3 - PellesC - mail: silvio[dot]falconi[at]gmail[dot]com
User avatar
Silvio.Falconi
 
Posts: 7090
Joined: Thu Oct 18, 2012 7:17 pm


Return to FiveWin for Harbour/xHarbour

Who is online

Users browsing this forum: No registered users and 82 guests