View Single Post
  #1 (permalink)  
Old March 18th, 2006, 11:33 AM
sreek_s sreek_s is offline
Registered User
 
Join Date: Mar 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Text to Speech using Java Script on Windows XP

Hi ,
I have installed WINDOWS Xp on my machine. SAPI (Microsoft Speech API) is in built in WINDOWS Xp. I am trying to implement Text - To - Speech using a java script. But i couldnt succeed.

Following is the code snippet i am running.

<HTML>
<HEAD>
<SCRIPT LANGUAGE="JavaScript">
var VoiceObj = new ActiveXObject("Sapi.SpVoice");
var my_test = "my test for you today is an amazing example";
function SpeakText() {
VoiceObj.Speak( my_test, 1 );
}
SpeakText()
</SCRIPT>
</HEAD>
</HTML>

Above script is failing at the following line :
var VoiceObj = new ActiveXObject("Sapi.SpVoice");

Error says 'Automation server cannot create object'

Can anyone tell me what is wrong with the above script. Do i need to install any other software on WINDOWS Xp to make Text - to - Speech work ?
Can anyone tell step by step procedure to implement Text - To - Speech on Windows XP machine using Java Script. And also what are the prerequisites for Text to Speech on Windows XP machine?
Code snippets are appreciable.

Regds,
Srikanth

Reply With Quote