JPLTedCas commited on
Commit
e8e90a7
1 Parent(s): ac388c7

Update templates/escuchar_uro1.html

Browse files
Files changed (1) hide show
  1. templates/escuchar_uro1.html +63 -52
templates/escuchar_uro1.html CHANGED
@@ -9,67 +9,78 @@
9
  <body>
10
  <div class="login22">
11
  <h2 style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;font-size: 3rem;background-color: saddlebrown;"><img src="{{ user_image7 }}" alt="" style="max-width:5%;" onclick="location.href='/especialidad'"> Urología </h2>
12
- <h3 style="padding-left: 80%;font-size: 1.2rem;" onclick="location.href='/ajustes'">AJUSTES <img src="{{ user_image6 }}" alt="" style="max-width:18%;" ></h3>
13
- <hr/>
14
  <h2 style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman';font-size: 1.7rem;">Asistente de voz:</h2>
15
- <form action="{{url_for('escuchar_uro1')}}" method="post">
16
- <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_uro'">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>
17
- <div id="output"></div>
18
-
19
- <script src="https://cdnjs.cloudflare.com/ajax/libs/socket.io/4.0.1/socket.io.js"></script>
20
  <script>
21
- const socket = io.connect('https://' + document.domain + ':' + location.port, { secure: true });
22
- const startRecordingButton = document.getElementById('startRecording');
23
- const outputDiv = document.getElementById('output');
24
- let mediaRecorder;
25
- let audioChunks = [];
26
- let recognition;
27
-
28
- startRecordingButton.addEventListener('click', () => {
29
- if (!recognition) {
30
- recognition = new webkitSpeechRecognition();
31
- recognition.lang = 'es-ES';
32
- recognition.onresult = function (event) {
33
- const result = event.results[0][0].transcript;
34
- socket.emit('audio_data', result);
35
- };
36
-
37
- }
38
- try {
39
- recognition.start();
40
- } catch (error) {
41
- console.error('Error al iniciar el reconocimiento de voz: ', error);
42
- }
43
- });
44
- socket.on('transcription', function (data) {
45
- outputDiv.innerHTML = 'Texto reconocido: ${data}';
46
- });
47
  </script>
48
-
49
-
50
-
51
- </form>
52
 
53
-
54
- <br>
55
- <br>
56
-
57
- <b style="font-size: 1.4rem;font-family: Arial, Helvetica, sans-serif;">{{prediction_text}}</b>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
58
 
59
  <br>
60
  <br>
61
 
62
  <b style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman';font-size: 1.8rem;">Selectores: </b>
63
- <br>
64
- <br>
65
- <img src="{{ user_image8 }}" style="max-width:20%;" onclick="location.href='/pdf_casa_uro?link2={{nid2}}'">
66
- <img src="{{ user_image9 }}" style="max-width:20%;" onclick="location.href='/protocolos_uro?link2={{nid2}}'" >
67
- <img src="{{ user_image10 }}" style="max-width:20%;" onclick="location.href='/guia_visual_uro?link2={{nid2}}'" >
68
- <br>
69
- <img src="{{ user_image11 }}" style="max-width:20%;" onclick="location.href='/videos_uro?link2={{nid2}}'">
70
- <img src="{{ user_image12 }}" style="max-width:20%;" onclick="location.href='/materiales_uro?link2={{nid2}}'">
71
-
72
-
73
  </div>
74
  </body>
75
  </html>
 
9
  <body>
10
  <div class="login22">
11
  <h2 style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman', serif;font-size: 3rem;background-color: saddlebrown;"><img src="{{ user_image7 }}" alt="" style="max-width:5%;" onclick="location.href='/especialidad'"> Urología </h2>
12
+ <h3 style="padding-left: 80%;font-size: 1.2rem;" onclick="location.href='/ajustes'">AJUSTES <img src="{{ user_image6 }}" alt="" style="max-width:18%;"></h3>
13
+ <hr />
14
  <h2 style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman';font-size: 1.7rem;">Asistente de voz:</h2>
15
+ <form action="{{url_for('escuchar_uro1')}}" method="post">
16
+ <button type="button" 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_uro'">Escuchar: <img src="{{ user_image5 }}" width="30% " style=" border-radius: 100%;box-shadow:2px 2px 2px 1px rgba(0, 0, 0, 0.2);" onclick="location.href='http://127.0.0.1:5000/escuchar_trauma'"></button>
 
 
 
17
  <script>
18
+ navigator.mediaDevices.getUserMedia({ audio: true }).then((stream) => {
19
+ const mediaRecorder = new MediaRecorder(stream)
20
+ })
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  </script>
 
 
 
 
22
 
23
+
24
+
25
+ </form>
26
+ <!---------------------------------------------------------------------------------------->
27
+
28
+ <div id="controls">
29
+ <button id="recordButton">Grabar Voz</button>
30
+ <!--<button id="pauseButton" disabled>Pause</button>-->
31
+ <button id="stopButton" disabled>Parar grabacion y buscar</button>
32
+ </div>
33
+ <div id="formats">Dele al botón "Grabar Voz". Cuando acabe, dele al botón "Parar grabación..." y obtendrá el resultado de la búsqueda</div>
34
+ <p><strong>Grabación:</strong></p>
35
+ <ol id="recordingsList"></ol>
36
+
37
+
38
+
39
+
40
+
41
+ <!-- inserting these scripts at the end to be able to use all the elements in the DOM -->
42
+ <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
43
+ <script src="https://cdn.rawgit.com/mattdiamond/Recorderjs/08e7abd9/dist/recorder.js"></script>
44
+ <script src="/static/js/appuro.js"></script>
45
+ <!-- Agrega un cuadro de texto para mostrar la respuesta -->
46
+ <!--<input type="text" id="responseTextBox" readonly>-->
47
+ <!--<div id="textElement">-->
48
+ <!-- El texto plano se mostrará aquí -->
49
+ <!--</div>-->
50
+ <!--<h1>Grabación de Audio</h1>
51
+
52
+
53
+
54
+
55
+
56
+ <br>
57
+ <br>
58
+
59
+ <!--<b style="font-size: 1.4rem;font-family: Arial, Helvetica, sans-serif;">{{prediction_text}}</b>-->
60
+
61
+ <br>
62
+ <br>
63
+ <!---------------------------------------------------------------------------------------->
64
+
65
+ <br>
66
+ <br>
67
+
68
+ <b style="font-size: 1.4rem;font-family: Arial, Helvetica, sans-serif;">{{prediction_text}}</b>
69
 
70
  <br>
71
  <br>
72
 
73
  <b style="font-family: Cambria, Cochin, Georgia, Times, 'Times New Roman';font-size: 1.8rem;">Selectores: </b>
74
+ <br>
75
+ <br>
76
+ <img src="{{ user_image8 }}" style="max-width:20%;" onclick="location.href='/pdf_casa_uro?link2={{nid2}}'">
77
+ <img src="{{ user_image9 }}" style="max-width:20%;" onclick="location.href='/protocolos_uro?link2={{nid2}}'">
78
+ <img src="{{ user_image10 }}" style="max-width:20%;" onclick="location.href='/guia_visual_uro?link2={{nid2}}'">
79
+ <br>
80
+ <img src="{{ user_image11 }}" style="max-width:20%;" onclick="location.href='/videos_uro?link2={{nid2}}'">
81
+ <img src="{{ user_image12 }}" style="max-width:20%;" onclick="location.href='/materiales_uro?link2={{nid2}}'">
82
+
83
+
84
  </div>
85
  </body>
86
  </html>