PHP wrapper for microsoft SAPI
Posted: Sun Jul 29, 2007 10:10 am
feyd | Please use
feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
I can not figure out the reason why this does not go past step 2, it will not go to 2a. Any help would be greatly appreciated. The ultimate goal here is to save a text to speech into a wav or mp3 file.Code: Select all
<?php
$Engine = new COM("SAPI.SpVoice");
$File = new COM("SAPI.SpFileStream");
echo "1</br>";
$File->Open("C:\\Website\\Test\\5.wav", 3, false);
echo "2</br>";
$Engine->AllowOutputFormatChangesOnNextSet = false;
echo "2a</br>";
$Engine->SetOutput($File,true);
echo "2b</br>";
$Engine->SetOutput($File);
echo "3</br>";
$Engine->Speak("Hello World!", SPF_DEFAULT);
echo "4</br>";
$File->Close();
echo "5</br>";
$File->Close();
unset($File);
unset($Engine);
?>feyd | Please use
Code: Select all
,Code: Select all
and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]