salomonsky commited on
Commit
c674762
·
verified ·
1 Parent(s): 646f9e5

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -5
app.py CHANGED
@@ -100,13 +100,15 @@ def main():
100
 
101
  audio_bytes = audiorecorder("Hablar", "Detener")
102
 
103
- if audio_bytes:
104
- audio_data = io.BytesIO(audio_bytes)
105
- audio_text = recognize_speech(audio_data)
 
 
 
106
 
107
  if audio_text:
108
  output, audio_file = generate(audio_text, history=st.session_state.history)
109
  display_recognition_result(audio_text, output, audio_file)
110
 
111
- if __name__ == "__main__":
112
- main()
 
100
 
101
  audio_bytes = audiorecorder("Hablar", "Detener")
102
 
103
+ if audio_data and 'bytes' in audio_data:
104
+ audio_bytes = audio_data['bytes']
105
+ st.audio(audio_bytes, format="audio/wav")
106
+ audio_data_io = io.BytesIO(audio_bytes)
107
+ audio_data_io.seek(0)
108
+ audio_text = recognize_speech(audio_data_io)
109
 
110
  if audio_text:
111
  output, audio_file = generate(audio_text, history=st.session_state.history)
112
  display_recognition_result(audio_text, output, audio_file)
113
 
114
+ if __name__ == "__main__":