FiveTech Support Forums

FiveWin / Harbour / xBase community
Board index FiveWin for Harbour/xHarbour Voice SPEAKING
Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Voice SPEAKING
Posted: Thu Jun 07, 2012 03:57 PM

This code work with XP and NOT with Win 7 64 !

include "fivewin.ch"

function main()

local oVoice := tOleAuto():New( "Sapi.SPVoice" )
local SSFMCreateForWrite := 1 && 3

oVoice:Speak( "Fivewin for harbour !" )

return .T.

Any idea ?

Thanks

Posts: 2706
Joined: Fri Oct 07, 2005 01:50 PM
Re: Voice SPEAKING
Posted: Thu Jun 07, 2012 07:05 PM

Jack

Is there a .dll file that goes with your code tOleAuto():New( "Sapi.SPVoice" ) ? If yes, perhaps it needs to be registered with Windows 7 ?

Just a quick thought.

Rick Lipkin

Posts: 300
Joined: Wed Jul 11, 2007 11:06 AM
Re: Voice SPEAKING
Posted: Thu Jun 07, 2012 07:13 PM

I do'nt install any DLL .

When i try the program on the same computer in XP Mode with Virtual PC, i hear the string .

I do'nt know what to do !

Thanks for your help .

Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Wed May 15, 2013 02:34 PM

Here it is working fine on Windows 8 32 bits :-)

Thanks!

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Wed May 15, 2013 02:41 PM
Inspecting "SAPI.SPVoice"

STDCALL dispatch FUNC void QueryInterface( [in] PTR, [out] PTR )
STDCALL dispatch FUNC unsigned long AddRef()
STDCALL dispatch FUNC unsigned long Release()
STDCALL dispatch FUNC void GetTypeInfoCount( [out] PTR )
STDCALL dispatch FUNC void GetTypeInfo( [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void GetIDsOfNames( [in] PTR, [in] PTR, [in] unsigned int, [in] unsigned long, [out] PTR )
STDCALL dispatch FUNC void Invoke( [in] int, [in] PTR, [in] unsigned long, [in] unsigned short, [in] PTR, [out] PTR, [out] PTR, [out] PTR )
STDCALL dispatch PROPERTYGET PTR Status()
STDCALL dispatch PROPERTYGET PTR Voice()
STDCALL dispatch PROPERTYPUTREF void Voice( [in] PTR )
STDCALL dispatch PROPERTYGET PTR AudioOutput()
STDCALL dispatch PROPERTYPUTREF void AudioOutput( [in] PTR )
STDCALL dispatch PROPERTYGET PTR AudioOutputStream()
STDCALL dispatch PROPERTYPUTREF void AudioOutputStream( [in] PTR )
STDCALL dispatch PROPERTYGET int Rate()
STDCALL dispatch PROPERTYPUT void Rate( [in] int )
STDCALL dispatch PROPERTYGET int Volume()
STDCALL dispatch PROPERTYPUT void Volume( [in] int )
STDCALL dispatch PROPERTYPUT void AllowAudioOutputFormatChangesOnNextSet( [in] VARIANT_BOOL )
STDCALL dispatch PROPERTYGET VARIANT_BOOL AllowAudioOutputFormatChangesOnNextSet()
STDCALL dispatch PROPERTYGET USERDEFINED EventInterests()
STDCALL dispatch PROPERTYPUT void EventInterests( [in] USERDEFINED )
STDCALL dispatch PROPERTYPUT void Priority( [in] USERDEFINED )
STDCALL dispatch PROPERTYGET USERDEFINED Priority()
STDCALL dispatch PROPERTYPUT void AlertBoundary( [in] USERDEFINED )
STDCALL dispatch PROPERTYGET USERDEFINED AlertBoundary()
STDCALL dispatch PROPERTYPUT void SynchronousSpeakTimeout( [in] int )
STDCALL dispatch PROPERTYGET int SynchronousSpeakTimeout()
STDCALL dispatch FUNC int Speak( [in] BSTR, [defaultvalue] USERDEFINED )
STDCALL dispatch FUNC int SpeakStream( [in] PTR, [defaultvalue] USERDEFINED )
STDCALL dispatch FUNC void Pause()
STDCALL dispatch FUNC void Resume()
STDCALL dispatch FUNC int Skip( [in] BSTR, [in] int )
STDCALL dispatch FUNC PTR GetVoices( [defaultvalue] BSTR, [defaultvalue] BSTR )
STDCALL dispatch FUNC PTR GetAudioOutputs( [defaultvalue] BSTR, [defaultvalue] BSTR )
STDCALL dispatch FUNC VARIANT_BOOL WaitUntilDone( [in] int )
STDCALL dispatch FUNC int SpeakCompleteEvent()
STDCALL dispatch FUNC VARIANT_BOOL IsUISupported( [in] BSTR, [defaultvalue] PTR )
STDCALL dispatch FUNC void DisplayUI( [in] int, [in] BSTR, [in] BSTR, [defaultvalue] PTR )
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Wed May 15, 2013 02:44 PM
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 845
Joined: Sun Oct 09, 2005 05:36 PM
Re: Voice SPEAKING
Posted: Wed May 15, 2013 09:13 PM

here not working windows 7 64 bits
Regards
Paco

____________________

Paco
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 09:40 AM

I have just tested it on Windows 8 64 bits and worked fine.

The only difference with Windows 8 32 bits is that on 64 bits a man talks, and on 32 bits is a lady :-)

Going to try it on Windows 7...

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 01:28 PM

Antonio,
this question is an old my question never resolved
I need to made a menu with option sound for a boy at school
On w7 it not run

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 01:52 PM
Hello,

In Windows 7 64 bits with BCC this code causes a GPF:

Code (fw): Select all Collapse
#include "fivewin.ch" 


function main()

 local oVoice := tOleAuto():New( "SAPI.SpVoice.1" )
 local SSFMCreateForWrite := 1 && 3

 oVoice:Speak( "Fivewin for harbour !. En Español" )

return .T.



But if I compile with MSVC 2010 runs perfect.
Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 01:53 PM

Silvio,

I just tested it on Windows 7 and it crashes. Its quite difficult to know why, as OLE objects are black boxes, with no source code.

But you could use this solution from your app:

viewtopic.php?f=3t=26337

using WinExec() or WinRun()

&

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 01:54 PM
Lucas,

But if I compile with MSVC 2010 runs perfect.


Very interesting observation, thanks! :-)
regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 44162
Joined: Thu Oct 06, 2005 05:47 PM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 01:56 PM

Lucas,

Please email me your (Microsoft) exe zipped and renamed to zop

I am on my laptop and don't have VS2010 installed yet here

regards, saludos

Antonio Linares
www.fivetechsoft.com
Posts: 1303
Joined: Tue Jul 21, 2009 08:12 AM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 02:11 PM

Antonio,

Here is it:

http://uploaded.net/file/x60842x9

Muchas gracias. Many thanks.



Un saludo, Best regards,



Harbour 3.2.0dev, Borland C++ 5.82 y FWH 13.06 [producción]



Implementando MSVC 2010, FWH64 y ADO.



Abandonando uso xHarbour y SQLRDD.
Posts: 7318
Joined: Thu Oct 18, 2012 07:17 PM
Re: Voice SPEAKING
Posted: Thu May 16, 2013 02:26 PM

Antonio,
please can you insert MSVC 2010 on your download list ?
I wish try if with it run

Since from 1991/1992 ( fw for clipper Rel. 14.4 - Momos)

I use : FiveWin for Harbour March-April 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