Thanks for that, it worked perfectly. Very exciting way to start understanding mac os related frameworks.

Best regards,

Yuma 








"Light has no value without darkness"
Mob: +61 (0)410732547
Skype: Shainobi1

This message is protected by article 4-210 of a certain book of laws but you don't have to worry about privacy issues if you are the intended recipient. However, if any freakish circumstance such as ip sniffing, honey pot open relay servers or an honest mistake caused a transmission error, please advise the sender and throw your laptop into a bubble bath to avoid all illicit data retention.

On 1/05/2013, at 11:43 PM, Ronald Oussoren <ronaldousso...@mac.com> wrote:


On 1 May, 2013, at 14:37, Yuma Antoine Decaux <jamy...@gmail.com> wrote:

Hi,

I've been trying to find a way to have speech output on an assignment GUI i'm working on for uni in Tkinter (they are forcing me) and since none of the UI elements on it are accessible, i'm trying to use either pyobjc with AppKit and some event handlers in Tkinter to get speech synthesis.

I've just successfully installed pyobjc and looked at the API notes. I couldn't find NSSynthesizer. Is this not available?

Just asking before i go any further.

NSSpeechSyntheziser is supported. There is nothing useful to mention beyond what's in the Apple documentation for the class, hence it is not mentioned in the API notes.

The following should work:

  from Cocoa import NSSpeechSynthesizer

  sp = NSSpeachSynthesizer.alloc().initWithVoice_(None) # use default voice
  sp.startSpeakingString_("hello world")

You should probably ensure that the synthesizer object hangs around until it is done speaking.

Ronald


_______________________________________________
Pythonmac-SIG maillist  -  Pythonmac-SIG@python.org
http://mail.python.org/mailman/listinfo/pythonmac-sig
unsubscribe: http://mail.python.org/mailman/options/Pythonmac-SIG

Reply via email to