Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

how to record pyttsx3 file using python

import pyttsx3
from gtts import gTTS

engine = pyttsx3.init(driverName='sapi5')
infile = "tanjil.txt"
f = open(infile, 'r')
theText = f.read()
f.close()

#Saving part starts from here 
tts = gTTS(text=theText, lang='en')
tts.save("saved_file.mp3")
print("File saved!")
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #record #file #python
ADD COMMENT
Topic
Name
4+1 =