Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -103,12 +103,11 @@ def main():
|
|
| 103 |
|
| 104 |
audio_bytes = audiorecorder("Hablar ▶️", "Detener 🛑")
|
| 105 |
if audio_bytes:
|
| 106 |
-
|
| 107 |
-
|
| 108 |
-
audio_text = recognize_speech(
|
| 109 |
-
|
| 110 |
if audio_text:
|
| 111 |
-
audio_bytes = audio_data.getvalue()
|
| 112 |
output, audio_file = generate(audio_text, history=st.session_state.history)
|
| 113 |
display_recognition_result(audio_text, output, audio_file)
|
| 114 |
|
|
|
|
| 103 |
|
| 104 |
audio_bytes = audiorecorder("Hablar ▶️", "Detener 🛑")
|
| 105 |
if audio_bytes:
|
| 106 |
+
audio_bytes = io.BytesIO(audio_bytes)
|
| 107 |
+
audio_bytes.seek(0)
|
| 108 |
+
audio_text = recognize_speech(audio_bytes)
|
| 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 |
|