Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Web Programming > JavaScript > Javascript
Password Reminder
Register
Register | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
Javascript General Javascript discussions.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old May 22nd, 2008, 11:23 AM
Friend of Wrox
Points: 489, Level: 7
Points: 489, Level: 7 Points: 489, Level: 7 Points: 489, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2006
Location: Berkshire, United Kingdom.
Posts: 104
Thanks: 9
Thanked 1 Time in 1 Post
Default Running SAPI.SpVoice with HTA or WSH


Chaps,

After several hours of googling and testing i have got a very simple text to voice javascript command to work.

Code:
<script language="javascript" type="text/javascript">
        var VoiceObj = new ActiveXObject("SAPI.SpVoice");
        VoiceObj.Speak("Voice Test");
    </script>
The issue i have is when i run it with no IE security changes i get "Automation server can not create object".

By further investigation i have found by enabling "Initialize and script ActiveX controls not marked as safe for scripting" in custom security settings / IE the script works fine.

I have found a non p2p forum posting which indicated that the scripting environment should be either HTA or WSH to combat the issue but have not found any working examples.

Has anyone got a better understanding of the two environments where SAPI.SpVoice has been integrated correctly.


Thanks

Aspless






Reply With Quote
  #2 (permalink)  
Old May 23rd, 2008, 03:33 AM
joefawcett's Avatar
Wrox Author
Points: 9,763, Level: 42
Points: 9,763, Level: 42 Points: 9,763, Level: 42 Points: 9,763, Level: 42
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jun 2003
Location: Exeter, , United Kingdom.
Posts: 3,074
Thanks: 1
Thanked 38 Times in 37 Posts
Default

Well you can either have a standalone script with a js extension that just contains the code you posted, no script tags, or you can rename your html page to be hta and then it becomes a scripted exe.
You can search for HTA on msdn.com for examples. Basically speech capabilities are quite dangerous, there are examples of people with speech recognition software running that have had files deleted by scripts that have spoken commands so unless your web app is running on a corporate intranet and you can make it a trusted site it's not suitable for general web use.

--

Joe (Microsoft MVP - XML)
Reply With Quote
  #3 (permalink)  
Old June 18th, 2008, 06:56 AM
Friend of Wrox
Points: 489, Level: 7
Points: 489, Level: 7 Points: 489, Level: 7 Points: 489, Level: 7
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Dec 2006
Location: Berkshire, United Kingdom.
Posts: 104
Thanks: 9
Thanked 1 Time in 1 Post
Default

Thanks joefawcett

I have created a policy for the trusted zone .. now works well.

Cheers

Aspless

Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
SAPI Jigna VB Components 0 March 6th, 2005 10:12 AM
CALLING a EXE from a HTA (or HTML) stalker Javascript 1 November 1st, 2004 02:18 AM
MS SAPI mega Classic ASP Professional 0 October 17th, 2004 12:46 PM
Can't find Sapi folder kara333 BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 0 September 5th, 2004 07:38 PM
WSH jgoodrow Pro VB.NET 2002/2003 1 August 17th, 2003 07:54 PM



All times are GMT -4. The time now is 03:15 AM.


Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.