Page 1 of 2

Voice SPEAKING

PostPosted: Thu Jun 07, 2012 3:57 pm
by Jack
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

Re: Voice SPEAKING

PostPosted: Thu Jun 07, 2012 7:05 pm
by Rick Lipkin
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

Re: Voice SPEAKING

PostPosted: Thu Jun 07, 2012 7:13 pm
by Jack
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 .

Re: Voice SPEAKING

PostPosted: Wed May 15, 2013 2:34 pm
by Antonio Linares
Here it is working fine on Windows 8 32 bits :-)

Thanks!

Re: Voice SPEAKING

PostPosted: Wed May 15, 2013 2:41 pm
by Antonio Linares
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 )

Re: Voice SPEAKING

PostPosted: Wed May 15, 2013 2:44 pm
by Antonio Linares

Re: Voice SPEAKING

PostPosted: Wed May 15, 2013 9:13 pm
by Francisco Horta
here not working windows 7 64 bits
Regards
Paco

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 9:40 am
by Antonio Linares
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...

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 1:28 pm
by Silvio.Falconi
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

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 1:52 pm
by lucasdebeltran
Hello,

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

Code: Select all  Expand view
#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.

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 1:53 pm
by Antonio Linares
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=3&t=26337

using WinExec() or WinRun()

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 1:54 pm
by Antonio Linares
Lucas,

But if I compile with MSVC 2010 runs perfect.


Very interesting observation, thanks! :-)

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 1:56 pm
by Antonio Linares
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

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 2:11 pm
by lucasdebeltran

Re: Voice SPEAKING

PostPosted: Thu May 16, 2013 2:26 pm
by Silvio.Falconi
Antonio,
please can you insert MSVC 2010 on your download list ?
I wish try if with it run