Skip to content

Instantly share code, notes, and snippets.

@kepsic
Created October 19, 2016 10:16
Show Gist options
  • Save kepsic/c4fc7e49fb4f8012c60791217360f699 to your computer and use it in GitHub Desktop.
Save kepsic/c4fc7e49fb4f8012c60791217360f699 to your computer and use it in GitHub Desktop.
#!/urs/bin/env python
import pyttsx
import argparse
import time
import sys
engine = pyttsx.init()
def onEnd(name, completed):
sys.exit(0)
parser = argparse.ArgumentParser(description='text to speech')
parser.add_argument('text')
args = parser.parse_args()
engine = pyttsx.init()
engine.connect('finished-utterance', onEnd)
engine.say(args.text)
engine.runAndWait()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment