码迷,mamicode.com
首页 > 其他好文 > 详细

前端上将字符串用语音读出来只能在IE上运行 其他不行 代码极少

时间:2014-11-27 18:17:08      阅读:208      评论:0      收藏:0      [点我收藏+]

标签:style   blog   http   io   ar   color   os   sp   java   

先保存保存自己的笔记 有高手看到求指点

bubuko.com,布布扣
 1  <script type="text/javascript">
 2         var VoiceObj;
 3         try {
 4             VoiceObj = new ActiveXObject("Sapi.SpVoice");
 5         }
 6         catch (e) {
 7             VoiceObj = null;
 8         }
 9         function InitializeControls() {
10             var VoicesToken = VoiceObj.GetVoices();
11             var AudioOutputsToken = VoiceObj.GetAudioOutputs();
12         }
13         if (null != VoiceObj) {
14             InitializeControls();
15         }
16         function SpeakText(strMsg) {
17             try {
18                 VoiceObj.Speak(strMsg, 1);
19 
20             }
21             catch (exception) {
22                 alert("Error");
23             }
24         }
25         function myClose() {
26             delete VoiceObj;
27         }
28         $(function () {
29             var ab = "111111111112333333";
30 })
31 </script>
View Code

 

前端上将字符串用语音读出来只能在IE上运行 其他不行 代码极少

标签:style   blog   http   io   ar   color   os   sp   java   

原文地址:http://www.cnblogs.com/weivvei/p/4126749.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!