Spaces:
Runtime error
Runtime error
DSatishchandra
commited on
Update app.py
Browse files
app.py
CHANGED
@@ -1,6 +1,13 @@
|
|
1 |
import pyttsx3
|
2 |
import speech_recognition as sr
|
3 |
from transformers import pipeline
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
|
5 |
# Initialize Text-to-Speech engine
|
6 |
engine = pyttsx3.init()
|
|
|
1 |
import pyttsx3
|
2 |
import speech_recognition as sr
|
3 |
from transformers import pipeline
|
4 |
+
from gtts import gTTS
|
5 |
+
import os
|
6 |
+
|
7 |
+
def speak(text):
|
8 |
+
tts = gTTS(text)
|
9 |
+
tts.save("response.mp3")
|
10 |
+
os.system("mpg321 response.mp3")
|
11 |
|
12 |
# Initialize Text-to-Speech engine
|
13 |
engine = pyttsx3.init()
|