I'm trying to create a live text-to-speech (TTS) page in PHP.
My TTS software is Cepstral for linux. It's a command line utility which works like this:
$ swift -n William "hello" -o hello.wav
This uses the "William" voice and outputs "hello" to a wave file.
I would like to create a form for a user to enter in text and press a submit button, in which the user then hears the sound. An example is on the Cepstral website main page at [a href=\"http://www.cepstral.com\" target=\"_blank\"]http://www.cepstral.com[/a] . Their setup appears to use an IFRAME and upon submission it embeds the file in the IFRAME below the textbox.
Ideally, it would be resourceful to have the sound file created dynamically within a PHP script and sent to the browser for play, thus eliminating the need to create the file locally on the webserver, play it, and then delete it.
Is this possible? If not, how are they doing it at cepstral.com ? Any ideas or help would be appreciated.
I'm looking into the possibility of using passthru() but the command line utility only outputs to a file. Is there a way to redirect output to PHP?