Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -8,7 +8,7 @@ def speak(text):
|
|
| 8 |
tts = gTTS(text=text, lang='en')
|
| 9 |
# Save the speech to a temporary audio file
|
| 10 |
tts.save("output.mp3")
|
| 11 |
-
# Play the saved audio file
|
| 12 |
os.system("mpg321 output.mp3")
|
| 13 |
|
| 14 |
# Function to listen to user voice input using SpeechRecognition
|
|
@@ -53,4 +53,3 @@ iface = gr.Interface(fn=voice_login, inputs=[], outputs="text", live=True)
|
|
| 53 |
|
| 54 |
# Launch the interface
|
| 55 |
iface.launch()
|
| 56 |
-
|
|
|
|
| 8 |
tts = gTTS(text=text, lang='en')
|
| 9 |
# Save the speech to a temporary audio file
|
| 10 |
tts.save("output.mp3")
|
| 11 |
+
# Play the saved audio file (works locally with mpg321)
|
| 12 |
os.system("mpg321 output.mp3")
|
| 13 |
|
| 14 |
# Function to listen to user voice input using SpeechRecognition
|
|
|
|
| 53 |
|
| 54 |
# Launch the interface
|
| 55 |
iface.launch()
|
|
|