Created
February 27, 2021 10:44
-
-
Save anupam-io/384d524e17466251dd87a74627c1cd0b to your computer and use it in GitHub Desktop.
Voice logging function in Python using gTTS
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def vlog(s): | |
s = str(s) | |
from gtts import gTTS | |
from os import system | |
language = 'en' | |
output = gTTS(text=s, lang=language, slow=False) | |
system("mkdir -p .vlogs") | |
output.save("./.vlogs/output.mp3") | |
system("ffplay -nodisp -autoexit ./.vlogs/output.mp3 >/dev/null 2>&1") | |
vlog("""SyntaxError: invalid syntax""") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment