Spaces:
Sleeping
Sleeping
Update templates/index.html
Browse files- templates/index.html +39 -60
templates/index.html
CHANGED
|
@@ -1,67 +1,46 @@
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
|
|
|
| 3 |
<head>
|
| 4 |
-
<
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 5 |
</head>
|
| 6 |
<body>
|
| 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 |
-
stopRecordingButton.disabled = true;
|
| 38 |
-
};
|
| 39 |
-
|
| 40 |
-
startRecordingButton.disabled = true;
|
| 41 |
-
stopRecordingButton.disabled = false;
|
| 42 |
-
|
| 43 |
-
mediaRecorder.start();
|
| 44 |
-
})
|
| 45 |
-
.catch(function (err) {
|
| 46 |
-
console.error('Error al acceder al micr贸fono:', err);
|
| 47 |
-
});
|
| 48 |
-
});
|
| 49 |
-
|
| 50 |
-
stopRecordingButton.addEventListener('click', () => {
|
| 51 |
-
mediaRecorder.stop();
|
| 52 |
-
sendAudioButton.disabled = false;
|
| 53 |
-
stopRecordingButton.disabled = true;
|
| 54 |
-
});
|
| 55 |
-
|
| 56 |
-
sendAudioButton.addEventListener('click', () => {
|
| 57 |
-
const audioBlob = new Blob(audioChunks, { 'type': 'audio/wav' });
|
| 58 |
-
socket.emit('audio_data', audioBlob);
|
| 59 |
-
audioChunks.length = 0; // Limpiar el array de fragmentos de audio
|
| 60 |
-
});
|
| 61 |
-
|
| 62 |
-
socket.on('transcription', function (data) {
|
| 63 |
-
outputDiv.innerHTML = `Texto reconocido: ${data}`;
|
| 64 |
-
});
|
| 65 |
-
</script>
|
| 66 |
</body>
|
| 67 |
</html>
|
|
|
|
|
|
|
|
|
| 1 |
<!DOCTYPE html>
|
| 2 |
<html>
|
| 3 |
+
|
| 4 |
<head>
|
| 5 |
+
<meta charset="UTF-8">
|
| 6 |
+
|
| 7 |
+
<title>TedCas Speech Recognition Modelo Cliente-Servidor</title>
|
| 8 |
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
| 9 |
+
|
| 10 |
+
|
| 11 |
</head>
|
| 12 |
<body>
|
| 13 |
+
<!-- Agregar un logotipo desde una URL -->
|
| 14 |
+
<img src="https://tse4.mm.bing.net/th?id=OIP.KUs6tP0b1rKLZ5lBq7JAEQHaDS&pid=Api&P=0&h=180" alt="Logotipo de la empresa" width="300" >
|
| 15 |
+
|
| 16 |
+
<h1>TedCas Speech Recognition Modelo Cliente-Servidor</h1>
|
| 17 |
+
<p>{{ recognized_text }}</p>
|
| 18 |
+
|
| 19 |
+
<div id="controls">
|
| 20 |
+
<button id="recordButton">Record</button>
|
| 21 |
+
<button id="pauseButton" disabled>Pause</button>
|
| 22 |
+
<button id="stopButton" disabled>Stop</button>
|
| 23 |
+
</div>
|
| 24 |
+
<div id="formats">Format: start recording to see sample rate</div>
|
| 25 |
+
<p><strong>Recordings:</strong></p>
|
| 26 |
+
<ol id="recordingsList"></ol>
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
<!-- inserting these scripts at the end to be able to use all the elements in the DOM -->
|
| 33 |
+
<script src="https://cdn.rawgit.com/mattdiamond/Recorderjs/08e7abd9/dist/recorder.js"></script>
|
| 34 |
+
<script src="/static/js/app.js"></script>
|
| 35 |
+
<!-- Agrega un cuadro de texto para mostrar la respuesta -->
|
| 36 |
+
<!--<input type="text" id="responseTextBox" readonly>-->
|
| 37 |
+
<div id="textElement">
|
| 38 |
+
<!-- El texto plano se mostrar谩 aqu铆 -->
|
| 39 |
+
</div>
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 43 |
</body>
|
| 44 |
</html>
|
| 45 |
+
|
| 46 |
+
|