Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -12,6 +12,7 @@ import io
|
|
| 12 |
import speech_recognition as sr
|
| 13 |
from gtts import gTTS
|
| 14 |
import os
|
|
|
|
| 15 |
|
| 16 |
# Download NLTK resources
|
| 17 |
nltk.download('punkt')
|
|
@@ -46,7 +47,7 @@ def recognize_speech():
|
|
| 46 |
st.error("Sorry, could not understand the audio.")
|
| 47 |
except sr.RequestError:
|
| 48 |
st.error("Could not request results, check your internet connection.")
|
| 49 |
-
return
|
| 50 |
|
| 51 |
|
| 52 |
# Preprocessing function (same as in Section 01)
|
|
|
|
| 12 |
import speech_recognition as sr
|
| 13 |
from gtts import gTTS
|
| 14 |
import os
|
| 15 |
+
import sounddevice as sd
|
| 16 |
|
| 17 |
# Download NLTK resources
|
| 18 |
nltk.download('punkt')
|
|
|
|
| 47 |
st.error("Sorry, could not understand the audio.")
|
| 48 |
except sr.RequestError:
|
| 49 |
st.error("Could not request results, check your internet connection.")
|
| 50 |
+
return Non
|
| 51 |
|
| 52 |
|
| 53 |
# Preprocessing function (same as in Section 01)
|