我一直在尝试执行此处给出的基本用法程序:https://github.com/cmusphinx/pocketsphinx-python?
下面有一个错误说没有这样的文件或目录,但是我打开了文件夹并且有goforward.raw文件
INFO: ngram_search_fwdflat.c(157): fwdflat: min_ef_width = 4, max_sf_win = 25
INFO: ngram_search_fwdtree.c(429): TOTAL fwdtree 0.00 CPU -nan xRT
INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 0.00 wall -nan xRT
INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.00 CPU -nan xRT
INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.00 wall -nan xRT
INFO: ngram_search.c(303): TOTAL bestpath 0.00 CPU -nan xRT
INFO: ngram_search.c(306): TOTAL bestpath 0.00 wall -nan xRT
Traceback (most recent call last):
File "voice.py", line 221, in <module>
stream = open(path.join(DATADIR, 'goforward.raw'), 'r+b')
IOError: [Errno 2] No such file or directory: '~/sphinx-source/pocketsphinx/test/data/goforward.raw'
INFO: ngram_search_fwdtree.c(429): TOTAL fwdtree 0.00 CPU -nan xRT
INFO: ngram_search_fwdtree.c(432): TOTAL fwdtree 0.00 wall -nan xRT
INFO: ngram_search_fwdflat.c(176): TOTAL fwdflat 0.00 CPU -nan xRT
INFO: ngram_search_fwdflat.c(179): TOTAL fwdflat 0.00 wall -nan xRT
INFO: ngram_search.c(303): TOTAL bestpath 0.00 CPU -nan xRT
INFO: ngram_search.c(306): TOTAL bestpath 0.00 wall -nan xRT
答案 0 :(得分:0)
~
符号仅扩展到您的主文件夹。 Python不会将~
扩展到您的主文件夹。
如果要指定文件名,请指定完整的绝对路径,例如
DATADIR = "/home/rahullab/sphinx-source/pocketsphinx/test/data"
或指定相对路径。