Text to speech, then save to file, serve to client
18 replies, posted
Hello, with PHP (Or I can have PHP launch an application that'll do it) I'd like to make a script that will take text, use speech to say it, then send it back.
How can I do this?
edit:
I'd have to use a middle program like I said above, so like
[PHP page] -system()-> [Program] -> either it's set by system (like 'app.exe -out:randomnumbers.wav') or it writes the url out
Well the fact that you are asking how you can do all these things subtly implies that you won't be able to do them, which to some might be funny.
It's not that funny really, I just don't know how to make speech and save it to a wav/mp3
I don't think it is funny as well, but I was explaining why people might be rating you funny. Sorry I don't have any experience with PHP, otherwise I would have helped you.
Just record microsoft sam, save as .wav, and add to your HLDJ/HLSS playlist.
Or buy a mic.
um... this has nothing to do with HLDJ/HLSS
[QUOTE=cas97;18513733]Hello, with PHP (Or I can have PHP launch an application that'll do it) I'd like to make a script that will take text, use speech to say it, then send it back.
How can I do this?[/QUOTE]
Long answer: You seem to underestimate the complexity of this task.
Short answer: RATED FUNNY LOL
You could use middleware I guess.
@steve vai: Boy that was helpful, I rate you wrenches.
@bmb: most useful post yet
It's really simple with SAPI from C++/COM, so go look for a Microsoft SAPI module for PHP.
If you have a text-to-speech converter program that can be run from the command line, you can use PHP's system() function to run it and make it put its output in a temp file, then send back the contents of the temp file.
If you were expecting to make your own text-to-speech engine in PHP, think again.
I found a program called Festival, but it's for *nix and I have windows :/
Use *nix host :D
It'd be your best bet anyway.
[editline]04:15PM[/editline]
Wait, did you plan on hosting this locally?
well right now I'm just using XAMPP
either way, my web host also is windows and I don't think I'd be able to run a program on it
if it's Eindows I guess you should be able to access the quite capable Microsoft Speech engine. though I have no clue whether PHP can do such a thing.
On linux, on unrestricted hosting (where PHP lets you run the passthru() function) you could've installed [url=http://www.speech.cs.cmu.edu/flite/]flite[/url], and invoked it like
[code]<?php
header("Content-type: audio/x-wav");
passthru("flite -t ".escapeshellcmd($_GET['text'])." | cat");
?>[/code]
Buuut it's very rare on shared hosting that they'd let you run system() calls, and you already said your webhost runs windows, so this post is completely pointless... ):
Somebody compile a windows32 version of Festival and/or flite.
:kiddo: please?
Also which is better? They look the same.
[editline]02:04PM[/editline]
also, bmb: I've been able to write php scripts that can get to other programs, so it can, I just don't know how to write the program
Why don't you? It's not to compile a program. And why not use a premade program?
because Festival and Flite don't come compiled, and I'm not sure how to
Sorry, you need to Log In to post a reply to this thread.