From 8496c0c26078dbb59e7ab0d6b1f87d4ee5b8969e Mon Sep 17 00:00:00 2001 From: Joe Rickard Date: Sat, 4 Jan 2020 12:29:40 +0000 Subject: [PATCH 1/2] Added input area for text talking speed #19 --- index.html | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 0cff9f4..1b71737 100644 --- a/index.html +++ b/index.html @@ -54,12 +54,15 @@ display: block; margin: 0 auto; } - input#submit, input#download-button, input#copy-link-button { + input#submit, input#download-button, input#copy-link-button, input#playback-speed-input { width: 248px; text-align: center; display: block; margin: 1em auto; } + input#playback-speed-input { + width: 240px ; + } input#copy-link-button { margin-bottom: 0; } @@ -127,7 +130,8 @@

phoneme synthesis

function process() { uipa = document.getElementById("ipa-input").value; - + playbackSpeed = document.getElementById("playback-speed-input").value; + document.getElementById("download-button").disabled = true; // nothing to process @@ -261,8 +265,8 @@

phoneme synthesis

uipa = uipa.replace(mappings[i].src, mappings[i].dest); //console.log(mappings[i].src + uipa); } - console.log(uipa); - spoken = meSpeak.speak('[['+uipa+']]', { 'rawdata': 'mime' }); + console.log(uipa); + spoken = meSpeak.speak('[['+uipa+']]', { 'rawdata': 'mime' , 'speed': playbackSpeed}); if (spoken == null) { alert("An error occurred: speaking failed."); } @@ -278,6 +282,7 @@

phoneme synthesis

Convert IPA phonetic notation to speech

+ From 444887761caf98b6ed74e1afc10d29175d52f870 Mon Sep 17 00:00:00 2001 From: Joe Rickard Date: Sat, 4 Jan 2020 12:46:02 +0000 Subject: [PATCH 2/2] Added talking speed to url when copying #19 --- index.html | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/index.html b/index.html index 1b71737..0e0eacd 100644 --- a/index.html +++ b/index.html @@ -124,7 +124,10 @@

phoneme synthesis

function copy_link_button() { uipa = document.getElementById("ipa-input").value; - url = window.location.href.split('?')[0] + "?w=" + uipa; + playbackSpeed = document.getElementById("playback-speed-input").value; + + url = window.location.href.split('?')[0] + "?w=" + uipa + "&s=" + playbackSpeed; + copyToClipboard(url); } @@ -327,10 +330,16 @@

note

(function() { var urlParams = new URLSearchParams(window.location.search); if(urlParams.has('w')) { - var word = urlParams.get('w'); - if(is_valid_input(word)) { + var word = urlParams.get('w'); + if(is_valid_input(word)) { document.getElementById("ipa-input").value = word; - } + } + } + if(urlParams.has('s')) { + var word = urlParams.get('s'); + if(is_valid_input(word)) { + document.getElementById("playback-speed-input").value = word; + } } })();