斗鱼开播提醒
🌎使用方法
💼Plus功能
🚀版本更新
3.4.10
3.3.6
3.3.5
3.3.4
3.3.3
3.3.2
3.2
🙏致谢
此 Script 继承了 @P- 的 原脚本 在此感谢 @P- 的开发工作。
🐊源码
源码
油猴脚本douyu_followpage源码1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
| function speak( { text, speechRate, lang, volume, pitch }, endEvent, startEvent ) { if (!window.SpeechSynthesisUtterance) { console.warn("当前浏览器不支持文字转语音服务"); return; }
if (!text) { return; } let onoff = GM_getValue("switchVoice", true); if (onoff != true) { return; }
let setlang = GM_getValue("LANG", "zh-CN"); let setrate = GM_getValue("RATE", 1); const speechUtterance = new SpeechSynthesisUtterance(); speechUtterance.text = text; speechUtterance.rate = speechRate || setrate; speechUtterance.lang = lang || setlang; speechUtterance.volume = volume || 1; speechUtterance.pitch = pitch || 1; speechUtterance.onend = function () { endEvent && endEvent(); }; speechUtterance.onstart = function () { startEvent && startEvent(); }; var timeFun = window.setInterval(function () { window.clearInterval(timeFun); speechSynthesis.speak(speechUtterance); }, 500);
return speechUtterance; }
|
Here is a footnote reference, and another.
Endnotes