DSatishchandra commited on
Commit
2878855
·
verified ·
1 Parent(s): 14dbc52

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +7 -0
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()