This works for me:

<snippet>
from Foundation import *
from AppKit import *
from PyObjCTools import NibClassBuilder, AppHelper

jabberwocky = '''Twas brillig and the slithy toves
did gyre and gimble in the wabe
all mimsy were the borogroves
and the mome raths outgrabe'''

class SpeechDelegate(NSObject):

     def applicationDidFinishLaunching_(self, notification):
         synth = NSSpeechSynthesizer.alloc()
         synth = synth.initWithVoice_ 
('com.apple.speech.synthesis.voice.Victoria')
         synth.startSpeakingString_(jabberwocky)


app = NSApplication.sharedApplication()
delegate = SpeechDelegate.alloc().init()
app.setDelegate_(delegate)

AppHelper.runEventLoop()

</snippet>
_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig

Reply via email to