Python Exercise #3 | Google text to speech with python | Technolazy

Veröffentlicht am: 19 Juli 2020
auf dem Kanal: Technolazy
28
0

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


Auf dieser Seite können Sie das Online-Video Python Exercise #3 | Google text to speech with python | Technolazy mit der Dauer stunde minuten sekunde in guter Qualität ansehen, das der Benutzer Technolazy 19 Juli 2020 hochgeladen hat, den Link mit Freunden und Bekannten teilen, dieses Video wurde auf Youtube bereits 28 Mal angesehen und es wurde von 0 den Zuschauern gefallen. Viel Spaß beim Betrachtenden Zuschauern gefallen!