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 is : 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. Code snippets are appreciable. Regds, Sreek
> Above script is failing at the following line : > var VoiceObj = new ActiveXObject("Sapi.SpVoice"); > > Error is : Automation Server cannot create object > Your problem is entirely IE browser security related when it comes to ActiveX components 'not marked as safe' which is a per zone setting and a per end user choice. A trusted host environment like WSH or HTA is a better design choice for your solution. > 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. > Code snippets are appreciable. > > Regds, > Sreek -- Michael Harris Microsoft MVP Scripting
Hi Michael, Thanks for your reply. Can you please elobarate the following lines. I am unable to understand. I mean how to achieve the following design. >A trusted host environment like WSH or HTA is a better design choice for > your solution. Also do you want me to change 'not marked as safe' settings to Enable in IE ? or how should be the settings in IE? Regds, Sreek "Michael Harris (MVP)" wrote: > > Above script is failing at the following line : > > var VoiceObj = new ActiveXObject("Sapi.SpVoice"); > > > > Error is : Automation Server cannot create object > > > > > Your problem is entirely IE browser security related when it comes to > ActiveX components 'not marked as safe' which is a per zone setting and a > per end user choice. > > A trusted host environment like WSH or HTA is a better design choice for > your solution. > > > > 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. > > Code snippets are appreciable. > > > > Regds, > > Sreek > > -- > Michael Harris > Microsoft MVP Scripting > > >
Hi Michel, I need this text to speech functionality in my JSP pages as well. In that case does HTA works ? My actual functionality could be as follows: 1. My web page should talk . 2. Alerts of my web page should talk. Most of the files are JSP pages. So please suggest me how can i achieve Text to Speech in JSP. I have tried saving my code with .hta extension and double clicked on it. I am able to hear the voice. But same code i have saved as .hta in my personal PC at home. And i doubled clicked on it. I couldnt hear the voice. Why is it working in one machine and not working in another machine. Both are same Windows XP machines. Regds, Sreek "sreek gupta" wrote: > Hi Michael, > Thanks for your reply. > Can you please elobarate the following lines. I am unable to understand. > I mean how to achieve the following design. > > >A trusted host environment like WSH or HTA is a better design choice for > > your solution. > > Also do you want me to change 'not marked as safe' settings to Enable in IE > ? or how should be the settings in IE? > > Regds, > Sreek > "Michael Harris (MVP)" wrote: > > > > Above script is failing at the following line : > > > var VoiceObj = new ActiveXObject("Sapi.SpVoice"); > > > > > > Error is : Automation Server cannot create object > > > > > > > > > Your problem is entirely IE browser security related when it comes to > > ActiveX components 'not marked as safe' which is a per zone setting and a > > per end user choice. > > > > A trusted host environment like WSH or HTA is a better design choice for > > your solution. > > > > > > > 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. > > > Code snippets are appreciable. > > > > > > Regds, > > > Sreek > > > > -- > > Michael Harris > > Microsoft MVP Scripting > > > > > >