Skip to content

Instantly share code, notes, and snippets.

@asadamatic
Created March 19, 2020 10:48
Show Gist options
  • Save asadamatic/46904c7ea2ee1fe9bb0c53e6d071477c to your computer and use it in GitHub Desktop.
Save asadamatic/46904c7ea2ee1fe9bb0c53e6d071477c to your computer and use it in GitHub Desktop.
A python program that converts a text message to audio, saves it and plays it using default audio player.
from gtts import gTTS
import os
message = 'Hello Asad!'
output = gTTS(text = message, lang= 'en', slow = False)
output.save('sayHello.mp3')
os.system('start sayHello.mp3')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment