66 lines
1.7 KiB
HTML
66 lines
1.7 KiB
HTML
<!DOCTYPE html>
|
|
<html lang="es">
|
|
<head>
|
|
<meta charset="UTF-8">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<title>{{title}}</title>
|
|
<style>
|
|
body {
|
|
font-family: Arial, sans-serif;
|
|
margin: 20px;
|
|
}
|
|
input, button {
|
|
margin: 10px 0;
|
|
padding: 5px;
|
|
}
|
|
#respuesta {
|
|
margin-top: 20px;
|
|
padding: 10px;
|
|
border: 1px solid #ccc;
|
|
background-color: #f9f9f9;
|
|
}
|
|
</style>
|
|
</head>
|
|
<body>
|
|
<h1>{{title}}</h1>
|
|
|
|
<select id="texto1">
|
|
{{Sal}}
|
|
</select>
|
|
|
|
<br>
|
|
<select id="texto2">
|
|
<option value="whisper">whisper</option>
|
|
<option value="vosk">vosk</option>
|
|
</select>
|
|
<br>
|
|
<button onclick="enviarPeticion()">Enviar petición</button>
|
|
<div id="respuesta"></div>
|
|
|
|
<script>
|
|
function enviarPeticion() {
|
|
const texto1 = document.getElementById('texto1').value;
|
|
const texto2 = document.getElementById('texto2').value;
|
|
const datos = {
|
|
path: texto1,
|
|
model: texto2
|
|
};
|
|
|
|
fetch('/EvalVoice', {
|
|
method: 'POST',
|
|
headers: {
|
|
'Content-Type': 'application/json'
|
|
},
|
|
body: JSON.stringify(datos)
|
|
})
|
|
.then(response => response.json())
|
|
.then(data => {
|
|
document.getElementById('respuesta').innerHTML = JSON.stringify(data, null, 2);
|
|
})
|
|
.catch(error => {
|
|
document.getElementById('respuesta').innerHTML = 'Error: ' + error;
|
|
});
|
|
}
|
|
</script>
|
|
</body>
|
|
</html> |