Hi!
As I've found tons of VB and C# sample codes, I was trying to transform
it into PHP code, using the COM objects. My aim is to create a simple
html, that creates a wav from a text. Here's what I've tried -the php
script part-:
$Voice = new COM("SAPI.SpVoi ce");//works
//com_load_typeli b("SAPI.SpVoice "); //This doesn't help...
$Voice->Speak("Hello!" ); //works
$FileStream = new COM("SAPI.SpFil eStream"); //works - I mean no error
$FileMode = SpeechStreamFil eMode.SSFMCreat eForWrite;// = 3 //works -
no error
$FileStream->Open("c:\a.wav ", 3, false); //works - no error
$Voice->AllowAudioOutp utFormatChanges OnNextSet = false; //works - no
error
$Voice->AudioOutputStr eam = $FileStream; //HERE'S THE PROBLEM
$Voice->Speak("Hello world",1);
$FileStream->Close();
Here's the error I get for that line:
Uncaught exception 'com_exception' with message 'Error [0x80020003]
Member not found
Can anyone please help?
Thanks, Peter
As I've found tons of VB and C# sample codes, I was trying to transform
it into PHP code, using the COM objects. My aim is to create a simple
html, that creates a wav from a text. Here's what I've tried -the php
script part-:
$Voice = new COM("SAPI.SpVoi ce");//works
//com_load_typeli b("SAPI.SpVoice "); //This doesn't help...
$Voice->Speak("Hello!" ); //works
$FileStream = new COM("SAPI.SpFil eStream"); //works - I mean no error
$FileMode = SpeechStreamFil eMode.SSFMCreat eForWrite;// = 3 //works -
no error
$FileStream->Open("c:\a.wav ", 3, false); //works - no error
$Voice->AllowAudioOutp utFormatChanges OnNextSet = false; //works - no
error
$Voice->AudioOutputStr eam = $FileStream; //HERE'S THE PROBLEM
$Voice->Speak("Hello world",1);
$FileStream->Close();
Here's the error I get for that line:
Uncaught exception 'com_exception' with message 'Error [0x80020003]
Member not found
Can anyone please help?
Thanks, Peter