Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/python-3.x/16.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Python 3.x ';配置';未定义Pocketsphinx Python_Python 3.x_Pocketsphinx - Fatal编程技术网

Python 3.x ';配置';未定义Pocketsphinx Python

Python 3.x ';配置';未定义Pocketsphinx Python,python-3.x,pocketsphinx,Python 3.x,Pocketsphinx,我已导入模块: from pocketsphinx.pocketsphinx import * from sphinxbase.sphinxbase import * LiveSpeech模块正在工作,我正在尝试使用以下方法禁用日志: config.set_string('-logfn', '/dev/null') 虽然我得到以下错误: 回溯(最近一次调用):config.set_字符串('-logfn','/dev/null')中的文件“/home/pi/Downloads/Test.py

我已导入模块:

from pocketsphinx.pocketsphinx import *
from sphinxbase.sphinxbase import *
LiveSpeech模块正在工作,我正在尝试使用以下方法禁用日志:

config.set_string('-logfn', '/dev/null')
虽然我得到以下错误:

回溯(最近一次调用):config.set_字符串('-logfn','/dev/null')中的文件“/home/pi/Downloads/Test.py”,第23行

NameError:未定义名称“config”**


您需要创建如下配置:

config = Decoder.default_config()
config.set_string('-logfn', '/dev/null')
decoder = Decoder(config)

您需要创建如下配置:

config = Decoder.default_config()
config.set_string('-logfn', '/dev/null')
decoder = Decoder(config)