salomonsky commited on
Commit
4ca9800
verified
1 Parent(s): 6f460e4

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +5 -2
app.py CHANGED
@@ -28,10 +28,10 @@ def recognize_speech(audio_data, show_messages=True):
28
  st.write(audio_text)
29
  st.success("Reconocimiento de voz completado.")
30
  except sr.UnknownValueError:
31
- st.warning("No se pudo reconocer el audio. 驴Intentaste grabar algo?")
32
  audio_text = ""
33
  except sr.RequestError:
34
- st.error("Hablame para comenzar!")
35
  audio_text = ""
36
 
37
  return audio_text
@@ -96,6 +96,9 @@ def display_recognition_result(audio_text, output, audio_file):
96
  unsafe_allow_html=True)
97
 
98
  def main():
 
 
 
99
  audio_bytes = audio_recorder(text="", recording_color="#A52A2A", neutral_color="#FFFFFF",)
100
 
101
  if audio_bytes:
 
28
  st.write(audio_text)
29
  st.success("Reconocimiento de voz completado.")
30
  except sr.UnknownValueError:
31
+ st.warning("Habla mas claro, cerca del micr贸fono.")
32
  audio_text = ""
33
  except sr.RequestError:
34
+ st.error("Presiona el boton y habla!")
35
  audio_text = ""
36
 
37
  return audio_text
 
96
  unsafe_allow_html=True)
97
 
98
  def main():
99
+ if not st.session_state.pre_prompt_sent:
100
+ st.session_state.pre_prompt_sent = True
101
+
102
  audio_bytes = audio_recorder(text="", recording_color="#A52A2A", neutral_color="#FFFFFF",)
103
 
104
  if audio_bytes: