Quantcast
Channel: PHP Freaks: PHP Help
Viewing all articles
Browse latest Browse all 13200

Running Microsoft Speech API console program in PHP

$
0
0

I wrote a simple console program using Microsoft Speech API to generate a .WAV file from a hard-coded text ("Hello world"). If I run the code directly on the console (on the server), it produces a correct .WAV file (about 60 kB). However, if I call the program from PHP:

 

<?php

$cmd = "helloTTS.exe"               // Program name

exec($cmd);

?>

 

The program runs and finishes, but the size of the .WAV file is only 46 bytes. I've tried using system(), shell_exec(), and passthru(), all with the same result. In another forum, somebody said that probably the buffer size of PHP is not enough to hold the amount of the generated data.

 

If it's the buffer, I guess it's the buffer of the PHP shell. How to check & increase the size of this buffer? And what else could cause this problem?


Viewing all articles
Browse latest Browse all 13200

Trending Articles