Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd9fb768

Browse files
authored
Native text to speech JS
1 parentaab98f5 commitd9fb768

File tree

1 file changed

+22
-1
lines changed

1 file changed

+22
-1
lines changed

‎README.md

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@
4545
|39|[Numeric separators allow us to improve our code readability](#Numeric-separators-allow-us-to-improve-our-code-readability)|
4646
|40|[pay attention when using every](#pay-attention-when-using-every)|
4747
|41|[How to convert an array of key-value tuples into an object](#How-to-convert-an-array-of-key-value-tuples-into-an-object)|
48-
48+
|42|[Native text to speech JS](#Native-text-to-speech-JS)|
4949

5050

5151

@@ -903,4 +903,25 @@ const obj = Object.fromEntries(JSarr);
903903
//}
904904
```
905905
906+
**[⬆ Back to Top](#table-of-contents)**
907+
### Native text to speech JS
908+
909+
910+
```javascript
911+
912+
const startSpeaking=()=>{
906913
914+
let msg = document.getElementById("text-to-speech").value;
915+
let speech = new SpeechSynthesisUtterance();
916+
917+
speech.lang ="en-US";
918+
speech.text = msg;
919+
speech.volume = 1;
920+
speech.rate = 1;
921+
speech.pitch = 1;
922+
923+
window.speechSynthesis.speak(speech);
924+
}
925+
926+
927+
```

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp