J'essaie d'exécuter un exemple simple d'utilisation de pocketsphinx. J'ai installé toutes les librairies, plugins nécessaires ... Python 2.7.6. Mais toujours obtenir une erreur:L'objet 'module' Python pocketsphinx n'a pas d'attribut 'Décodeur'
pocketsphinx 'module' object has no attribute 'Decoder'
import sys,os
import pocketsphinx as ps
import sphinxbase
def decodeSpeech(hmmd,lmdir,dictp,wavfile):
speechRec = ps.Decoder(hmm = hmmd, lm = lmdir, dict = dictp)
wavFile = file(wavfile,'rb')
wavFile.seek(44)
speechRec.decode_raw(wavFile)
result = speechRec.get_hyp()
return result[0]
if __name__ == "__main__":
hmdir = '/usr/share/pocketsphinx/model/hmm/wsj1'
lmd = '/usr/share/pocketsphinx/model/lm/wsj/wlist5o.3e-7.vp.tg.lm.DMP'
dictd = '/usr/share/pocketsphinx/model/lm/wsj/wlist5o.dic'
wavfile = "msg_12c3da80-c6be-11e3-9430-eb6ba5ab4d1f.wav"
recognised = decodeSpeech(hmdir,lmd,dictd,wavfile)
Est-ce Python 3.x? Avez-vous lu https://github.com/bambocher/pocketsphinx-python#import? – jonrsharpe
Python 2.7.6. Oui j'ai fait toutes les instructions. – Arti
Que montre 'print dir (ps)'? 'print ps .__ fichier__'? – jonrsharpe