Problems using SAPI with PHP through COM, on IIS -
i attempting text speech , speech recognition work in php using microsoft's sapi through com objects.
in past, used code tts work (apache 2.1, php 5.5, on windows 2003 server)
// instantiate object $voiceobj = new com("sapi.spvoice") or die("unable instantiate sapi"); // available voices $voicestoken=$voiceobj->getvoices(); $numberofvoices=$voicestoken->count; for($i=0;$i<$numberofvoices;$i++) { $voicetoken=$voicestoken->item($i); $voicename[$i]=$voicetoken->getdescription(); } // , print id of specified voice $selectedvoicetoken=$voicestoken->item(0); $selectedvoicetokenid=$selectedvoicetoken->id; // set voice $voiceobj->voice=$selectedvoicetoken; $voicename=$voiceobj->voice->getdescription(); $voicefile = new com("sapi.spfilestream"); $voicefile->open('./test.wav', 3, false); // speak file $voiceobj->audiooutputstream = $voicefile; $voiceobj->speak("what unbelievable test", 0); $voicefile->close();
on new setup (iis 7.5, php 7.0, windows server 2008r2) same code fails at
$voiceobj->speak("what unbelievable test", 0); fatal error: uncaught com_exception: <b>source:</b> unknown<br/><b>description:</b> unknown in \\web\tts.php:30 stack trace: #0 \\web\tts.php(30): com->speak('this marve...', 0) #1 {main}
with such little detail (where retrieve more?) can't figure out problem may be.
writing permissions checked. php 7.0 replaced 5.5, still not working. same code tested win32 app, , works flawlessly.
any hints?
Comments
Post a Comment