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

Pubblicato il: 19 luglio 2020
sul canale di: 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


In questa pagina del sito puoi guardare il video online Python Exercise #3 | Google text to speech with python | Technolazy della durata di ore minuti seconda in buona qualità , che l'utente ha caricato Technolazy 19 luglio 2020, condividi il link con amici e conoscenti, su youtube questo video è già stato visto 28 volte e gli è piaciuto 0 spettatori. Buona visione!