Hi friends,
This video shows how to create audio file using google text to speech module and create automated audio file with python
Required modules: gtts
install using: pip install gtts
Sample code used in video below:
from gtts import gTTS
import os
import time
print("Hello, Welcome to Booking Agency")
get_name= input("Please Enter your Name : ")
print('\n')
print("Good Morning %s : " %get_name)
get_travel = input("What is your favourite holiday destiny?: ")
print("Well, %s is an excellent choice" %get_travel)
print('\n')
get_date = input("Please select the month you wish to travel? :")
print("Please wait until we check the ticket availibility.")
time.sleep(3)
print("Generating ticket.. please wait...")
time.sleep(3)
language = 'en'
read_text = "Hello %s, you have choosen your holiday destiny as %s and tickets are available at %s, but unfortunately due to covid 19 it is not recommended to travel outside. Please stay home and stay safe with your family" %(get_name,get_travel,get_date)
audio = gTTS(text=read_text,lang=language)
audio.save('sampleaudio.wav')
os.system('sampleaudio.wav')
#end of code
python exercises
python simple application
python tutorial
python exercises
python examples
Sur cette page du site, vous pouvez voir la vidéo en ligne Python Exercise #3 | Google text to speech with python | Technolazy durée heure minute seconde en bonne qualité , qui a été Téléchargé par l'utilisateur Technolazy 19 juillet 2020, Partagez le lien avec vos amis et connaissances, sur youtube cette vidéo a déjà été regardée 28 fois et il a aimé 0 téléspectateurs. Bon visionnage!