Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -100,13 +100,15 @@ def main():
|
|
| 100 |
|
| 101 |
audio_bytes = audiorecorder("Hablar", "Detener")
|
| 102 |
|
| 103 |
-
if
|
| 104 |
-
|
| 105 |
-
|
|
|
|
|
|
|
|
|
|
| 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__":
|
|
|