speechSynthesis
/* $timeout.cancel(timer); */
window.speechSynthesis.onvoiceschanged = function(e) {
voices = speechSynthesis.getVoices();
};
window.speechSynthesis.onvoiceschanged();
var msg = new SpeechSynthesisUtterance();
function speak(text) {
msg.text = text;
msg.volume = 1;
msg.rate = 0.8;
msg.pitch = 1;
msg.voice = voices[4];
window.speechSynthesis.speak(msg);
}
function speak1(text) {
msg.text = text;
msg.volume = 1;
msg.rate = 0.8;
msg.pitch = 1;
msg.voice = voices[3];
window.speechSynthesis.speak(msg);
}
msg.onend = function(event) {
console.log('Finished in ' + event.elapsedTime + ' seconds.');
};
clearTimeout(timer1);
var timer1 = setTimeout(function(){
speak("Order No. 11"); },0);
clearTimeout(timer2);
var timer2 =setTimeout( function(){speak1("Order No. 11"); },5000);
speechSynthesis的更多相关文章
- speechSynthesis,TTS语音合成。
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...
- js文字转语音(speechSynthesis)
环境: windows 官网网址: https://developer.mozilla.org/en-US/docs/Web/API/SpeechSynthesis 基础使用: var msg = n ...
- Xamarin+Prism开发详解六:DependencyService与IPlatformInitializer的关系
祝各位2017年事业辉煌!开年第一篇博客,继续探索Xamarin.Forms… 为什么我做Xamarin开发的时候中意于Prism.Forms框架?本章为你揭晓. 实例代码地址:https://git ...
- 后HTML5时代
十二年前,无论多么复杂的布局,在我们神奇的table面前,都不是问题:十年前,阿捷的一本<网站重构>,为我们开启了新的篇章:八年前,我们研究yahoo.com,惊叹它在IE5下都表现得如此 ...
- this
JavaScript 中的 this ! 2016-12-28 vvv阿城 JavaScript 转自 https://qiutc.me/post/this-this-this-in-javascr ...
- MacDev.Mach-O.Programming-Part-III:MachOView-v2.4.9200.dmg-crash
MachOView-v2.4.9200.dmg Crash 在OS X(其版本号: 10.11.6 (15G31))下载MachOView-2.4.9200.dmg后,打开Fat Binary后,Ma ...
- JavaScript中call,apply,bind方法的总结。
why?call,apply,bind干什么的?为什么要学这个? 一般用来指定this的环境,在没有学之前,通常会有这些问题. var a = { user:"追梦子", fn:f ...
- JavaScript 中的 this ,看着一篇就够了
tip 在 js 中,this 这个上下文总是变化莫测,很多时候出现 bug 总是一头雾水,其实,只要分清楚不同的情况下如何执行就 ok 了. 全局执行 首先,我们在全局环境中看看它的 this 是什 ...
- 重新想象 Windows 8.1 Store Apps (87) - TTS: Speak Text, Speak SSML
[源码下载] 重新想象 Windows 8.1 Store Apps (87) - TTS: Speak Text, Speak SSML 作者:webabcd 介绍重新想象 Windows 8.1 ...
随机推荐
- IPC
IPC,全名Inter Process Communication即进程间通讯,在同一台机器上的两个进程就用IPC,不能跨物理机器。IPC包括共享内存、队列、信号量等几种方式,由于IPC通讯效率之高, ...
- 设置irb和ri
设置irb和ri 输入ruby -v查看是否能够显示ruby版本 现在可以 配置irb了. irb是交互式Ruby 的命令行工具,即输入一句就立即执行并给出结果. 默认的irb不够强大,现在给它配置一 ...
- 数据库连接driverClass和jdbcUrl大全
一.MySQL: driverClass:com.mysql.jdbc.Driver org.gjt.mm.mysql.Driver jdbcUrl:j ...
- spring环境搭建需要的插件-------Spring Tool Suite™ Downloads
下载地址http://spring.io/tools/sts/all 上面的是集成了eclipse的,所以文件比较大,下面的是单独的插件,下载之后打开eclipse,help->installN ...
- html+css复习之第3篇 | jquery | bootstrap
html+css复习之第3篇 | jquery | bootstrap
- [windows API]获取当前系统图标,文字大小
取DPI 缩放比例 HWND wnd = ::GetDesktopWindow(); dbg_print("desktopwnd:0x%X\n",wnd); HDC dc = G ...
- 2015弱校联盟(2) - J. Usoperanto
J. Usoperanto Time Limit: 8000ms Memory Limit: 256000KB Usoperanto is an artificial spoken language ...
- Team Queue (uva540 队列模拟)
Team Queue Queues and Priority Queues are data structures which are known to most computer scientist ...
- noi 8462 大盗阿福
题目链接:http://noi.openjudge.cn/ch0206/8462/ 相邻的两个不能同时取, d[i] = max(d[i-1],d[i-2]+a[i]); http://paste.u ...
- Android SQLite数据库使用
在Android开发中SQLite起着很重要的作用,网上SQLite的教程有很多很多,不过那些教程大多数都讲得不是很全面.本人总结了一些SQLite的常用的方法,借着论坛的大赛,跟大家分享分享的.一. ...