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

Publicado el: 19 julio 2020
en el canal de: 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


En esta página del sitio puede ver el video en línea Python Exercise #3 | Google text to speech with python | Technolazy de Duración hora minuto segunda en buena calidad , que subió el usuario Technolazy 19 julio 2020, comparta el enlace con amigos y conocidos, en youtube este video ya ha sido visto 28 veces y le gustó 0 a los espectadores. Disfruta viendo!