TTS in windows

Mark Hammond skippy.hammond at gmail.com
Thu Feb 12 00:47:21 EST 2009


On 12/02/2009 3:58 PM, Jonathan Chacón wrote:
> Hello,
>
> I need to use SAPI5 text to speech with python but I don't find anything
> that lets me manage speech, tone, volume, etc
>
>
> Does anybody know anything to do this?

It appears this is doable from COM.  With the pywin32 package:

 >>> import win32com.client
 >>> o=win32com.client.Dispatch("{96749377-3391-11D2-9EE3-00C04F797396}")
 >>> o.Speak("Hello there")
1
 >>> o.Volume
100
 >>> o.Volume=50
 >>> o.Speak("Hello there")
1

Works for me on Vista.  The magic number is the value for CLSID_SpVoice, 
which I found by googling (for some reason, the actual definition of 
that CLSID doesn't appear in the SDK headers...)

HTH,

Mark



More information about the Python-list mailing list