Ashrafb commited on
Commit
134b6b7
1 Parent(s): 13821bb

Create static/index.html

Browse files
Files changed (1) hide show
  1. static/index.html +35 -0
static/index.html ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <!DOCTYPE html>
2
+ <html>
3
+ <head>
4
+ <title>Text-to-Speech</title>
5
+ </head>
6
+ <body>
7
+ <h1>Text-to-Speech Conversion</h1>
8
+ <form action="/convert" method="post">
9
+ <textarea name="text" rows="5" cols="50" placeholder="Enter text here"></textarea><br>
10
+ <select name="voice">
11
+ <option value="">Select Voice</option>
12
+ <!-- Options will be populated dynamically -->
13
+ </select><br>
14
+ <label for="rate">Speech Rate Adjustment (%):</label>
15
+ <input type="range" id="rate" name="rate" min="-50" max="50" value="0"><br>
16
+ <label for="pitch">Pitch Adjustment (Hz):</label>
17
+ <input type="range" id="pitch" name="pitch" min="-20" max="20" value="0"><br>
18
+ <input type="submit" value="Convert">
19
+ </form>
20
+ <script>
21
+ async function populateVoices() {
22
+ const response = await fetch('/voices');
23
+ const voices = await response.json();
24
+ const select = document.querySelector('select[name="voice"]');
25
+ for (const [key, value] of Object.entries(voices)) {
26
+ const option = document.createElement('option');
27
+ option.value = key;
28
+ option.textContent = key;
29
+ select.appendChild(option);
30
+ }
31
+ }
32
+ populateVoices();
33
+ </script>
34
+ </body>
35
+ </html>