Jump to content

PHP Wrapper for Microsoft SAPI


legojedi

Recommended Posts

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.

 

 

<?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);

?>

Link to comment
https://forums.phpfreaks.com/topic/62220-php-wrapper-for-microsoft-sapi/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.