Skip to content

Instantly share code, notes, and snippets.

@tgck
Created August 20, 2012 16:23
Show Gist options
  • Save tgck/3405498 to your computer and use it in GitHub Desktop.
Save tgck/3405498 to your computer and use it in GitHub Desktop.
simpleSpeakSynthesizer2
from AppKit import NSSpeechSynthesizer
voices = NSSpeechSynthesizer.availableVoices()
voices = [x.split(".")[-1] for x in voices]
voice = "com.apple.speech.synthesis.voice." + voices[-1]
speech = NSSpeechSynthesizer.alloc().initWithVoice_(voice)
speech.startSpeakingString_("Hello World!")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment