views:

429

answers:

5

I am trying to make a PHP script talk to the user. Do I need flash?

+1  A: 

I assume by talk, you mean play audio. You do not need flash, javascript can do this.

Ray
A: 

Use JavaScript, yes. To compile the audio, use http://public.research.att.com/~ttsweb/tts/demo.php. If you wanted to be a real hacker, you can write a script that posts to that website and receives the response (which contains a link). Pass the URL of the audio file to the user through your JavaScript. Presto, text-to-speech.

Stefan Mai
AHA! THank you this is good. However I do not want to be a hacker I have had run-ins with the law before and it never ends well :(
being a Hacker is not a bad thing, now being a cracker involves illegal activity, hackers are good people, at least we like to think we are.
Unkwntech
John: http://catb.org/jargon/html/H/hacker.html
Lars Mæhlum
+4  A: 

On a windows server you can do:

 $voice = new COM("SAPI.SpVoice");
 $voice->Speak("Hello, lets have a conversation");

For linux you'll need php-vox installed. Check out a demo page of it working here.

Eran Galperin
Wouldn't the COM version make the webserver speak, not the end user's pc?
Tom Haigh
A: 

If you want to avoid Flash, a cool but somewhat new plugin that has a service for local text to speech is Yahoo's BrowserPlus. The specific service you want to look at is the TextToSpeech service (http://browserplus.yahoo.com/developer/services/ , scroll down to TextToSpeech). To implement, it requires a javascript call and for your user to install the BrowserPlus plugin.

mweiss
A: 

Your question is still not specific enough. Talking can have many possible contexts. Do you mean a program that will read aloud syntax errors? Do you mean a talking IDE? Or do you mean a program that will converse with a programmer, as in a Dialog System? The computational requirements for each of the three are vastly different, as is the level of their AI.

Yuval F