Menu

Trouble running pocketsphinx in python

Help
Rishabh
2014-10-12
2014-10-12
  • Rishabh

    Rishabh - 2014-10-12

    I have a .py file as meintioned below:

    import sys
    import pocketsphinx
    if name == "main":
    hmdir = "/usr/share/pocketsphinx/model/hmm/wsj1"
    lmdir = "/usr/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP"
    dictd = "/usr/share/pocketsphinx/model/lm/wsj/wlist5o.dic"
    wavfile = sys.argv[1]

    speechRec = pocketsphinx.Decoder(hmm = hmdir, lm = lmdir, dict = dictd)
    wavFile = file(wavfile,'rb')
    speechRec.decode_raw(wavFile)
    result = speechRec.get_hyp()

    print result

    but is gives following error:

    Traceback (most recent call last):
    File "voice.py", line 2, in <module>
    import pocketsphinx
    File "sphinxbase.pxd", line 150, in init pocketsphinx (pocketsphinx.c:7935)
    ValueError: PyCapsule_GetPointer called with invalid PyCapsule object

    I have tried re-install pocketsphinx but it still shows the same error.

    Please help.
    thank you for patience reading

     
    • Nickolay V. Shmyrev

      You can download latest sphinxbase and pocketsphinx from github:

      http://github.com/cmusphinx

      It contains new SWIG Python API which should work on your system without PyCapsule issues. You can find examples of new API in pocketsphinx/swig/python/test folder.

       

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.