aash29 / pyspeech

Automatically exported from code.google.com/p/pyspeech
0 stars 0 forks source link

Example code failed in speech 0.3.5 #7

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Hello gundlach ,

example code in your home page is failing again :-(
You forgot the ":" symbol after def L1callback(phrase, listener) !
After correcting this error in code I have the following error

D:\dev\py\speech>example_home_page035.py
Traceback (most recent call last):
  File "D:\dev\py\speech\example_home_page035.py", line 8, in <module>
    L1 = speech.listenfor(["any of", "these will", "match"], L1callback)
  File "D:\Python25\lib\site-packages\speech-0.3.5-py2.5.egg\speech.py",
line 14
8, in listenfor
  File "D:\Python25\lib\site-packages\speech-0.3.5-py2.5.egg\speech.py",
line 15
9, in _startlistening
  File
"D:\Python25\lib\site-packages\win32com\gen_py\C866CA3A-32F7-11D2-9602-00
C04F8EE628x0x5x0.py", line 2468, in CreateRecoContext
    ret = self._oleobj_.InvokeTypes(10, LCID, 1, (9, 0), (),)
pywintypes.com_error: (-2147352567, 'Exception occurred.', (0, None, None,
None,
 0, -2147221164), None)

Python 2.5
WinXP pro
Speech 0.3.5 egg
M$ speech pack 5.1

Thanks
Great project :-)

Original issue reported on code.google.com by cyk...@gmail.com on 6 Aug 2008 at 2:46

GoogleCodeExporter commented 9 years ago
Code fixed on home page.  And tested this time :)

Thanks for your report.  I can't repro the error you described; when I copy the
homepage example into a file and run
  python.exe test.py
I get into the sleep loop just fine.

The error message you receive seems to be "Class not registered".  It might be 
worth
attempting the following:
  - Delete the folder D:\Python25\lib\site-packages\win32com\gen_py\
  - Rerun the example code
  - If it still fails, delete the gen_py folder again if it exists, 
    then reinstall Microsoft Speech SDK 5.1 from http://tinyurl.com/5m6v2 .

Let me know how it goes.

Original comment by gundl...@gmail.com on 7 Aug 2008 at 3:04

GoogleCodeExporter commented 9 years ago

Original comment by gundl...@gmail.com on 7 Aug 2008 at 3:04

GoogleCodeExporter commented 9 years ago
Hello Michael ,

Deleting the folder was not enough. I have to reinstall Speech pack !
I retry your example on your home page. It fails again :-D
NameError : name 'do_some_other_stuff' is not defined
I comment this line (this function is not defined (Funny !) and now it WORKS !
Wow !
I soon try with the new version 0.4.1

Thank for the fast update !
Cyke64

Original comment by cyk...@gmail.com on 8 Aug 2008 at 8:32

GoogleCodeExporter commented 9 years ago
Great to hear that it works for you!  And I'll clarify the homepage example -- 
thanks
for your feedback.

Good luck, and enjoy!

Michael

Original comment by gundl...@gmail.com on 8 Aug 2008 at 12:30