#1
  1. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65

    Red face pyTTS gives error


    Has anyone used the pyTTS SAPI speech module successfully? I get an error in one of the wincom modules, that's as far as I get!
    Code:
     Traceback (most recent call last):
      File "C:\Python24\Lib\site-packages\pythonwin\pywin\framework\scriptutils.py", line 310, in RunScript
        exec codeObject in __main__.__dict__
      File "C:\Python24\SpeechTest\Speech1.py", line 1, in ?
        import pyTTS
      File "C:\Python24\Lib\site-packages\pyTTS\__init__.py", line 1, in ?
        from pyTTS import pyTTS, tts_default, tts_async, tts_purge_before_speak, tts_is_filename, \
      File "C:\Python24\Lib\site-packages\pyTTS\pyTTS.py", line 9, in ?
        gencache.EnsureModule('{C866CA3A-32F7-11D2-9602-00C04F8EE628}', 0, 5, 0)
      File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line 393, in EnsureModule
        module = GetModuleForTypelib(typelibCLSID, lcid, major, minor)
      File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line 258, in GetModuleForTypelib
        mod = _GetModule(modName)
      File "C:\Python24\Lib\site-packages\win32com\client\gencache.py", line 629, in _GetModule
        mod = __import__(mod_name)
      File "C:\Python24\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00C04F8EE628x0x5x0.py", line 1192
         """Add"""
         ^
     SyntaxError: invalid syntax
    Checked the code in that file, seems to be okay. Even reinstalled pywin32-204.win32-py2.4.exe
    My testcode is:
    Code:
    import pyTTS
    
    tts = pyTTS.Create()
    tts.Speak('This is the sound of my voice.')
  2. #2
  3. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    I have used it and it work perfectly

    I suggest you redownload everything

    http://www.cs.unc.edu/~parente/tech/tr02.shtml
    Those people who think they know everything are a great annoyance to those of us who do.
  4. #3
  5. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65

    Red face


    Thanks MM,

    I uninstalled, redownloaded and reinstalled the following:
    SAPI5SpeechInstaller.msi
    SAPI5VoiceInstaller.msi
    pywin32-204.win32-py2.4.exe
    pyTTS-3.0.win32-py2.4.exe

    and now I am down to just this error message:
    Traceback (most recent call last):
    File "C:/Python24/Atest/Speech1.py", line 3, in ?
    tts = pyTTS.Create()
    File "C:\Python24\Lib\site-packages\pyTTS\__init__.py", line 28, in Create
    raise ValueError('"%s" not supported' % api)
    ValueError: "SAPI" not supported
    when I use this simple test code:
    Code:
    import pyTTS
    
    tts = pyTTS.Create()
    tts.Speak('This is the sound of my voice.')
    I do have an XP box. I am lost again!
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    did u use any %s anywhere where it might have contact because by me it works fine.
    Those people who think they know everything are a great annoyance to those of us who do.
  8. #5
  9. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65

    Red face


    I looked at __init__.py in the \pyTTS folder and added a few test prints. It looks like it can't find sapi.py even though it is right there in the same folder. Beats me!

    Maybe the problem is with PYTHONPATH? I appended the path list, but the error persists.

    Code:
    import sys
    
    # append dynamically from program
    sys.path.append('C:\Python24\Lib\site-packages\pyTTS')
    
    for path in sys.path:
        print path
    Is there a chance you send me the result of your sys.path?

    I really would like the speech thing to work. I am beginning to think Python is too quirky to work with!
  10. #6
  11. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    >>> sys.path
    ['E:\\Python\\Lib\\idlelib', 'C:\\WINDOWS\\system32\\python24.zip', 'E:\\Python', 'E:\\Python\\DLLs', 'E:\\Python\\lib', 'E:\\Python\\lib\\plat-win', 'E:\\Python\\lib\\lib-tk', 'E:\\Python\\lib\\site-packages', 'E:\\Python\\lib\\site-packages\\PIL', 'E:\\Python\\lib\\site-packages\\win32', 'E:\\Python\\lib\\site-packages\\win32\\lib', 'E:\\Python\\lib\\site-packages\\Pythonwin', 'E:\\Python\\lib\\site-packages\\wx-2.5.3-msw-ansi']

    Those are mine and I can import it perfectly

    I really dont know what does not work I suggest you email the creator person... or group
    Last edited by monkeyman23555; July 4th, 2005 at 01:47 PM.
    Those people who think they know everything are a great annoyance to those of us who do.
  12. #7
  13. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65

    Red face


    Oops, I compared your Pythonpath to mine. Pretty much the same except for the drive, but where your path shows
    'C:\\WINDOWS\\system32\\python24.zip'
    mine shows
    'C:\\Python24\\python24.zip'
    that zip file is not in that directory!!! It is in the same as yours! I don't know why this happened and don't how to correct that.
  14. #8
  15. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65

    Red face


    Well Python24.zip wasn't the problem. Actually there is no such thing anyway!? Not on my XP box.

    I can get the speech thing going in oldfashioned basic, Python still fizzles out!

    If anyone has ideas, please let me know! I really like Python better than basic.
  16. #9
  17. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    lol

    Basic

    Okay I suggested this before and I will again write a mail to the creator person and what OS do you use
    Those people who think they know everything are a great annoyance to those of us who do.
  18. #10
  19. Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Feb 2005
    Posts
    605
    Rep Power
    65

    Talking


    MM,

    fcol, I did sent Peter an e-mail. Hopefully he can help. In the mean time basic to the resque, works great!
  20. #11
  21. No Profile Picture
    Contributing User
    Devshed Novice (500 - 999 posts)

    Join Date
    Nov 2004
    Location
    There where the rabbits jump
    Posts
    556
    Rep Power
    11
    Good hehe I just said it because I did not know
    Those people who think they know everything are a great annoyance to those of us who do.

IMN logo majestic logo threadwatch logo seochat tools logo