From b6847b27684aa6eaa37f002fff5d276a44cbae62 Mon Sep 17 00:00:00 2001 From: Chris Date: Tue, 17 Nov 2020 22:07:15 -0500 Subject: [PATCH] speech finish --- speech/Test.html | 7 +++++++ speech/Test.js | 15 ++++++++++++--- speech/style.css | 29 +++++++++++++++++++++++++++++ 3 files changed, 48 insertions(+), 3 deletions(-) create mode 100644 speech/style.css diff --git a/speech/Test.html b/speech/Test.html index 1ad207d..8664900 100644 --- a/speech/Test.html +++ b/speech/Test.html @@ -4,8 +4,15 @@ Document + +
+ + +

+
+ \ No newline at end of file diff --git a/speech/Test.js b/speech/Test.js index 72073e5..84b2dc6 100644 --- a/speech/Test.js +++ b/speech/Test.js @@ -4,16 +4,25 @@ if ('speechSynthesis' in window) { }else{ alert('error') } +let num = 1; // alert("test"); var msg = new SpeechSynthesisUtterance(); var voices = window.speechSynthesis.getVoices(); -msg.voice = voices[10]; +// msg.voice = voices[01]; msg.volume = 1; // From 0 to 1 msg.rate = 1; // From 0.1 to 10 msg.pitch = 0; // From 0 to 2 -msg.text = "1"; +msg.text = num; msg.lang = 'en'; -speechSynthesis.speak(msg); \ No newline at end of file +// +function test(){ +document.getElementById("out").onclick = ""; +document.getElementById("out").innerHTML = num; +msg.text = num; + speechSynthesis.speak(msg); + num= num+1; + document.getElementById("out").onclick = "out()"; +} \ No newline at end of file diff --git a/speech/style.css b/speech/style.css new file mode 100644 index 0000000..514ed8c --- /dev/null +++ b/speech/style.css @@ -0,0 +1,29 @@ +.container{ + display: flex; + flex-direction: column; + justify-items: center; + align-items: center; + background-color: cornflowerblue; + padding: 20px; + height: 100%; + +} +body{ + box-sizing: border-box; + margin: 0; + background-color: cornflowerblue; +} +#btn{ + color: blueviolet; + background-color: pink; + height: 200px; + width: 200px; + font-size: 4rem; + border-radius: 50%; + border: none; + font-family: Verdana, Geneva, Tahoma, sans-serif; + +} +h1{ + font-size: 7rem; +} \ No newline at end of file