Spaces:
Runtime error
Runtime error
File size: 3,218 Bytes
3de77ce |
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 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 |
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title> Quirohelp </title>
</head>
<body>
<div class="login22">
<h2 style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;font-size: 3rem;background-color: darkcyan;"><img src="{{ user_image7 }}" alt="" style="max-width:5%;" onclick="location.href='/especialidad'"> Traumatología</h2>
<h3 style="padding-left: 80%;font-size: 1.2rem;" onclick="location.href='/ajustes'">AJUSTES <img src="{{ user_image6 }}" alt="" style="max-width:18%;" ></h3>
<hr/>
<h2 style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman';font-size: 1.7rem;">Asistente de voz:</h2>
<form action="{{url_for('escuchar_trauma1')}}" method="post">
<button type="button" id="startRecording" style="padding-right: 85%; font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman'; font-size: 1.2rem; padding-left: 1%; background-color: white; border: solid white;">
Escuchar: <img src="{{ user_image5 }}" width="30%" style="border-radius: 100%; box-shadow: 2px 2px 2px 1px rgba(0, 0, 0, 0.2);">
</button>
<div id="output"></div>
<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, { secure: true });
const startRecordingButton = document.getElementById('startRecording');
const outputDiv = document.getElementById('output');
let recognition;
function startRecognitionAndRedirect() {
if (!recognition) {
recognition = new webkitSpeechRecognition();
recognition.lang = 'es-ES';
recognition.onresult = function (event) {
const result = event.results[0][0].transcript;
socket.emit('audio_data', result);
recognition.stop(); // Detiene el reconocimiento después de recibir un resultado
window.location.href = '/escuchar_trauma'; // Redirige a otra página después del reconocimiento
};
}
try {
recognition.start();
} catch (error) {
console.error('Error al iniciar el reconocimiento de voz:', error);
}
}
startRecordingButton.addEventListener('click', startRecognitionAndRedirect);
</script>
</form>
<br>
<br>
<b style="font-size: 1.4rem;font-family: Arial, Helvetica, sans-serif;">{{prediction_text}}</b>
<br>
<br>
<b style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman';font-size: 1.8rem;">Selectores: </b>
<br>
<br>
<img src="{{ user_image8 }}" style="max-width:20%;" onclick="location.href='/pdf_casa_trauma?link2={{nid2}}'">
<img src="{{ user_image9 }}" style="max-width:20%;" onclick="location.href='/protocolos_trauma?link2={{nid2}}'" >
<img src="{{ user_image10 }}" style="max-width:20%;" onclick="location.href='/guia_visual_trauma?link2={{nid2}}'" >
<br>
<img src="{{ user_image11 }}" style="max-width:20%;" onclick="location.href='/videos_trauma?link2={{nid2}}'">
<img src="{{ user_image12 }}" style="max-width:20%;" onclick="location.href='/materiales_trauma?link2={{nid2}}'">
</div>
</body>
</html> |