File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments