<details>
<summary>渡口</summary>
</details>
<details>
<summary>金海心</summary>
</details>
<details>
<summary>水仙</summary>
</details>
本帖最后由 马黑黑 于 2022-6-26 23:19 编辑 <br /><br /><style>
.mama { margin: auto; width: 720px; }
.mama p, .mama h2 { margin: 0; padding: 6px 0; }
#shutbtn { position: fixed; top: 50%; left: 20%; outline: none; }
#shutbtn:hover { color: red; cursor: pointer; }
</style>
<div class="mama">
<h2>TTS朗读被选中的文本</h2>
<input id="shutbtn" type="button" value="关闭" />
<p>通过鼠标选中本页任何地方的文本,如果Windows自带的TTS引擎正常,选中的文本会被系统默认的合成语音朗读。可以通过左边的按钮关闭。</p>
</div>
<script>
let synth = window.speechSynthesis,
speech = new SpeechSynthesisUtterance();
let shut = document.querySelector('#shutbtn');
shutbtn.onclick = function() {
if(speech.text) synth.cancel(speech);
}
document.addEventListener("mouseup", readSelected, true);
//document.addEventListener("keyup", readSelected, true);
//speech.addEventListener('end', () => window.getSelection().removeAllRanges());
//朗读被选中的文本
function readSelected() {
speech.text = window.getSelection().toString();
synth.speak(speech);
}
</script>
花潮LRC在线v3下载:
<details>
<summary>summernight</summary>
</details>
<details>
<summary>summernight no2</summary>
</details>
<details>
<summary>summer palace</summary>
</details>
<details>
<summary>格格</summary>
</details>
本帖最后由 马黑黑 于 2022-6-29 13:11 编辑 <br /><br /><details>
<summary>midnight bounce</summary>
</details>
<details>
<summary>芳满亭</summary>
</details>
<details>
<summary>ufo</summary>
</details>
<details>
<summary>大漠</summary>
<details>
本帖最后由 马黑黑 于 2022-7-9 23:45 编辑 <br /><br /><details>
<summary>Girl</summary>
</details>
<details>
<summary>Stage</summary>
</details>
<details>
<summary>bee</summary>
</details>
<details>
<summary>Night</summary>
</details>
本帖最后由 马黑黑 于 2022-11-6 11:27 编辑 <br /><br /><div style="position: absolute; width: 1024px; height: 200px; left: 50%; margin-left: -512px; border: 1px solid;">position: absolute; width: 1024px; height: 200px; left: 50%; margin-left: -512px; </div>
<div style="position: relative; widht: 1024px; height: 200px; margin: auto 0px; border: 1px solid red;"></div>