Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -6,6 +6,9 @@ from gtts import gTTS
|
|
6 |
from audiorecorder import audiorecorder
|
7 |
import speech_recognition as sr
|
8 |
|
|
|
|
|
|
|
9 |
def recognize_speech(audio_data, show_messages=True):
|
10 |
recognizer = sr.Recognizer()
|
11 |
audio_recording = sr.AudioFile(audio_data)
|
@@ -73,10 +76,8 @@ def text_to_speech(text, speed=1.3):
|
|
73 |
audio_fp.seek(0)
|
74 |
return audio_fp
|
75 |
|
76 |
-
def main():
|
77 |
-
if "history" not in st.session_state:
|
78 |
-
st.session_state.history = []
|
79 |
|
|
|
80 |
audio_data = audiorecorder("Habla para grabar", "Deteniendo la grabaci贸n...")
|
81 |
|
82 |
if not audio_data.empty():
|
|
|
6 |
from audiorecorder import audiorecorder
|
7 |
import speech_recognition as sr
|
8 |
|
9 |
+
if "history" not in st.session_state:
|
10 |
+
st.session_state.history = []
|
11 |
+
|
12 |
def recognize_speech(audio_data, show_messages=True):
|
13 |
recognizer = sr.Recognizer()
|
14 |
audio_recording = sr.AudioFile(audio_data)
|
|
|
76 |
audio_fp.seek(0)
|
77 |
return audio_fp
|
78 |
|
|
|
|
|
|
|
79 |
|
80 |
+
def main():
|
81 |
audio_data = audiorecorder("Habla para grabar", "Deteniendo la grabaci贸n...")
|
82 |
|
83 |
if not audio_data.empty():
|