MAKE TEXT TO SPEECH CONVERTER APP USING PYTHON

Publié le: 21 février 2021
sur la chaîne: Rajat Bisht
87
10

code:
"""
@author: Rajat Bisht
"""

#---------------------------importing required modules------------------------
import pyttsx3

#--------------__main__----------------------------------

converter=pyttsx3.init()
b='''type 1 to convert text to speech
type 2 to get list of voices
type 3 to change voice'''
print(b)
converter.say(b)
converter.runAndWait()


user=input("Enter your choice: ")

for m in range(5):
if user=='1':
a=input("Enter what you want to say: ")
converter.setProperty('rate',170)
converter.say(a)
converter.runAndWait()
qeu=input("Press y if you want to save it: ")
if qeu=='y':
converter.save_to_file(a,'converted.mp3')

if user=='2':
voices = converter.getProperty('voices')
for voice in voices:
to get the info. about various voices in our PC
print("Voice:")
print("ID: %s" %voice.id)
print("Name: %s" %voice.name)
print("Age: %s" %voice.age)
print("Gender: %s" %voice.gender)
print("Languages Known: %s" %voice.languages)

if user=='3':
b=input('enter voice id: ')
a=input("Enter what you want to say: ")
c=float(input('enter the speed exapmle 1x or 2x or 3x'))
d=c*100
converter.setProperty('voice', c)
converter.setProperty('rate',d)
converter.runAndWait()
qeu=input("Press y if you want to save it: ")
if qeu=='y':
converter.save_to_file(a,'converted.mp3')

#MyFirstApp, #PythonToExe #TextToSpeechUsingPython
#pyttsx3
#PythonToExe


Sur cette page du site, vous pouvez voir la vidéo en ligne MAKE TEXT TO SPEECH CONVERTER APP USING PYTHON durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Rajat Bisht 21 février 2021, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 87 fois et il a aimé 10 téléspectateurs. Bon visionnage!