diff --git a/src/public/index.html b/src/public/index.html index 6faf2f5..9cc6d63 100644 --- a/src/public/index.html +++ b/src/public/index.html @@ -99,15 +99,20 @@ for (var i = 0; i < voiceEles.length; i++) if (voiceEles[i].checked) voiceIdx = voiceEles[i].value; - - ws.send(JSON.stringify({ + + const data = JSON.stringify({ "Text": input.value, "Pitch": Number.parseInt(document.getElementById("pitch").value, 10), "Rate": Number.parseFloat(document.getElementById("rate").value, 10), "VoiceIdx": Number.parseInt(voiceIdx, 10), - })); + }); + + ws.send(data); print("SENT: " + input.value); input.value = ""; + if (document.getElementById("listen").checked) { + ws.onmessage({data: data}); + } return false; }; }); @@ -129,6 +134,9 @@ + + +