File size: 1,486 Bytes
ab9f226
dd1b723
 
326d719
 
 
 
dd1b723
 
326d719
 
 
dd1b723
326d719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
326d719
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
dd1b723
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8" />
  <meta name="viewport" content="width=device-width, initial-scale=1.0"/>
  <title>Speech Transcriber with Transformers.js</title>
  <link rel="stylesheet" href="style.css" />
</head>
<body>
  <div class="container">
    <h1>🎙️ Speech Transcriber</h1>
    <p>Upload an audio file or use a sample to transcribe speech using Transformers.js (Whisper Tiny EN).</p>

    <!-- Audio Input -->
    <div class="input-section">
      <label for="audioInput">Choose an audio file:</label>
      <input type="file" id="audioInput" accept="audio/*" />
      <button id="useSample">Or Use Sample Audio</button>
    </div>

    <!-- Options -->
    <div class="options-section">
      <label>Transcription Mode:</label>
      <div class="options">
        <label><input type="radio" name="mode" value="normal" checked /> Normal</label>
        <label><input type="radio" name="mode" value="chunks" /> With Chunks</label>
        <label><input type="radio" name="mode" value="words" /> Word-level Timestamps</label>
      </div>
    </div>

    <!-- Audio Player -->
    <div class="player-section">
      <audio id="player" controls></audio>
    </div>

    <!-- Status -->
    <div id="status">Ready to transcribe.</div>

    <!-- Output -->
    <div class="output-section">
      <h2>Transcription Result</h2>
      <pre id="output"></pre>
    </div>
  </div>

  <script type="module" src="index.js"></script>
</body>
</html>