Skip to content

Commit

Permalink
Added input area for text talking speed itinerarium#19
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalekdan committed Jan 4, 2020
1 parent 4995835 commit 8496c0c
Showing 1 changed file with 9 additions and 4 deletions.
13 changes: 9 additions & 4 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down Expand Up @@ -127,7 +130,8 @@ <h1>phoneme synthesis</h1>

function process() {
uipa = document.getElementById("ipa-input").value;

playbackSpeed = document.getElementById("playback-speed-input").value;

document.getElementById("download-button").disabled = true;

// nothing to process
Expand Down Expand Up @@ -261,8 +265,8 @@ <h1>phoneme synthesis</h1>
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.");
}
Expand All @@ -278,6 +282,7 @@ <h1>phoneme synthesis</h1>
<p style="text-align: center;"><em>Convert <abbr title="International Phonetic Alphabet">IPA</abbr> phonetic notation to speech</em></p>
<form onsubmit="process(); return false;">
<input id="ipa-input" onchange="clear_download_button(); return false;" type="text" value="/mʊmˈbaɪ/" />
<input id="playback-speed-input" type="number" min="1" value="175">
<input id="submit" onclick="process(); return false;" type="button" value="pronounce" />
<input id="download-button" onclick="download(); return false;" type="button" disabled="disabled" value="download pronunciation" />
<input id="copy-link-button" onclick="copy_link_button(); return false;" type="button" value="copy share url" />
Expand Down

0 comments on commit 8496c0c

Please sign in to comment.