Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -5,10 +5,10 @@ def listen(audio):
|
|
| 5 |
r = sr.Recognizer()
|
| 6 |
audio_file = sr.AudioFile(audio)
|
| 7 |
with audio_file as source:
|
| 8 |
-
|
| 9 |
try:
|
| 10 |
-
text = r.recognize_google(
|
| 11 |
-
return
|
| 12 |
except:
|
| 13 |
return "Sorry could not recognize what you said"
|
| 14 |
|
|
|
|
| 5 |
r = sr.Recognizer()
|
| 6 |
audio_file = sr.AudioFile(audio)
|
| 7 |
with audio_file as source:
|
| 8 |
+
aud = r.listen(source)
|
| 9 |
try:
|
| 10 |
+
text = r.recognize_google(aud, language='ur')
|
| 11 |
+
return text
|
| 12 |
except:
|
| 13 |
return "Sorry could not recognize what you said"
|
| 14 |
|