Spaces:
Runtime error
Runtime error
<html> | |
<head> | |
<title>WebSockets y Reconocimiento de Voz</title> | |
</head> | |
<body> | |
<div id="output"></div> | |
<button onclick="startRecognition()">Comenzar Reconocimiento</button> | |
<script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script> | |
<script> | |
const socket = io.connect('https://' + document.domain + ':' + location.port); | |
socket.on('response', function (message) { | |
const output = document.getElementById('output'); | |
output.innerHTML = message; | |
}); | |
function startRecognition() { | |
socket.emit('recognize_speech'); | |
} | |
</script> | |
</body> | |
</html> | |