1

Is there pyTTS or some kind of speech module for python 3.0? I can't seem to find it anywhere and I'd really like to try it out.

3 Answers3

3

On windows, simplest way would be to directly access SAPI using python com interface, e.g.

import win32com.client
speaker = win32com.client.Dispatch("SAPI.SpVoice")
speaker.Speak("Hello, it works!")
Anurag Uniyal
  • 85,954
  • 40
  • 175
  • 219
  • I have tried this already but it doesn't work for me. Maybe it's because I'm running 64bit Win 7? (I have installed win32com but I can't import it) –  Jul 19 '10 at 19:01
  • hmm not sure abt 64bit Win 7, may be that is another question for SO – Anurag Uniyal Jul 20 '10 at 03:05
  • So looks like that I didn't have Microsoft speech sdk installed, but even now when I do have that installed I still can't import it. I read that I have to run makepy (tools | COM makepy utility | ... ) or something to make this work, but I don't seem to find it. Could you help me with this? –  Aug 19 '10 at 21:08
  • Traceback (most recent call last): File "", line 1, in import win32com.client File "C:\Python31\lib\site-packages\win32com\__init__.py", line 5, in import win32api, sys, os ImportError: DLL load failed: The specified module could not be found. –  Aug 22 '10 at 15:38
  • This is when I try to import win32com.client (import win32com.client) –  Aug 22 '10 at 15:38
  • May be you said ask a separate question regarding problems with win32com – Anurag Uniyal Aug 23 '10 at 10:32
0

I'm using win7 x64. I installed pywin32 and Anurag Uniyal's answer worked.

Here is the latest build at the time of this writing. http://sourceforge.net/projects/pywin32/files/pywin32/Build%20218/

You see there are 2 versions:
pywin32-218.win32-py3.1.exe
pywin32-218.win-amd64-py3.1.exe

Keep in mind that even if your OS is 64b, you might have installed python3 32b or python3 64b. For example, I have win7 x64 but I installed python3 32b. If that's your case, choose win32; if not chose amd64.

Good luck

Lazik
  • 2,480
  • 2
  • 25
  • 31
0

Festival is the only TTS engine for Linux I know of, and it has pyfestival - http://code.google.com/p/pyfestival/ .

In the past I wrote my own bindings because the interface was so simple.

Forrest Voight
  • 2,249
  • 16
  • 21