Update static/index.html
Browse files- static/index.html +3 -3
static/index.html
CHANGED
@@ -39,12 +39,12 @@
|
|
39 |
});
|
40 |
|
41 |
document.getElementById("generateButton").addEventListener("click", async () => {
|
42 |
-
const
|
43 |
-
if (
|
44 |
const response = await fetch("/tts/", {
|
45 |
method: "POST",
|
46 |
headers: { "Content-Type": "application/json" },
|
47 |
-
body: JSON.stringify({ text
|
48 |
});
|
49 |
const audioData = await response.blob();
|
50 |
document.getElementById("audioPlayer").src = URL.createObjectURL(audioData);
|
|
|
39 |
});
|
40 |
|
41 |
document.getElementById("generateButton").addEventListener("click", async () => {
|
42 |
+
const inputText = prompt("Enter text to convert to speech:");
|
43 |
+
if (inputText) {
|
44 |
const response = await fetch("/tts/", {
|
45 |
method: "POST",
|
46 |
headers: { "Content-Type": "application/json" },
|
47 |
+
body: JSON.stringify({ text:inputText})
|
48 |
});
|
49 |
const audioData = await response.blob();
|
50 |
document.getElementById("audioPlayer").src = URL.createObjectURL(audioData);
|