Spaces:
Sleeping
Sleeping
<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" onclick="location.href='/escuchar_trauma'">Escuchar: <img src="{{ user_image5 }}" width="60% " style=" border-radius: 100%;box-shadow:2px 2px 2px 1px rgba(0, 0, 0, 0.2);" onclick="location.href='/escuchar_trauma'"></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 mediaRecorder; | |
let audioChunks = []; | |
let recognition; | |
startRecordingButton.addEventListener('click', () => { | |
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); | |
}; | |
} | |
try { | |
recognition.start(); | |
} catch (error) { | |
console.error('Error al iniciar el reconocimiento de voz: ', error); | |
} | |
}); | |
socket.on('transcription', function (data) { | |
outputDiv.innerHTML = `Texto reconocido: ${data}`; | |
}); | |
</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> |