QuirohelpASRServer / templates /escuchar_admision1.html
JPLTedCas's picture
Upload 39 files
3de77ce
raw
history blame
No virus
2.94 kB
<!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: gray;"><img src="{{ user_image7 }}" alt="" style="max-width:5%;" onclick="location.href='/especialidad'"> Admisión: </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_admision1')}}" 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_admision'">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_admision'"></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:30%;" onclick="location.href='/mapa_camas'">
<img src="{{ user_image9 }}" style="max-width:30%;" onclick="location.href='/ambulancias'" >
<br>
<img src="{{ user_image10 }}" style="max-width:30%;" onclick="location.href='/programacion_quirurgica'">
<img src="{{ user_image11 }}" style="max-width:30%;" onclick="location.href='/otros'" >
</div>
</body>
</html>