我试图在Qt中使用CMU Sphinx。我已经安装了pocketsphinx和sphinxbase,并在Qt中创建了一个项目,并将以下代码添加到user@my-ec2-instance:~/redis-3.2.8$ ./src/redis-cli -h redis-host --latency-history -i 1
min: 0, max: 12, avg: 0.45 (96 samples) -- 1.01 seconds range
min: 0, max: 1, avg: 0.33 (96 samples) -- 1.00 seconds range
min: 0, max: 3, avg: 0.33 (96 samples) -- 1.01 seconds range
min: 0, max: 2, avg: 0.29 (96 samples) -- 1.01 seconds range
min: 0, max: 2, avg: 0.26 (96 samples) -- 1.01 seconds range
min: 0, max: 1, avg: 0.34 (96 samples) -- 1.00 seconds range
min: 0, max: 4, avg: 0.34 (96 samples) -- 1.01 seconds range
min: 0, max: 1, avg: 0.26 (96 samples) -- 1.00 seconds range
min: 0, max: 5, avg: 0.33 (96 samples) -- 1.01 seconds range
min: 0, max: 1, avg: 0.31 (96 samples) -- 1.00 seconds range
min: 0, max: 1, avg: 0.33 (96 samples) -- 1.00 seconds range
min: 0, max: 1, avg: 0.28 (96 samples) -- 1.00 seconds range
min: 0, max: 1, avg: 0.30 (96 samples) -- 1.00 seconds range
min: 0, max: 4, avg: 0.35 (96 samples) -- 1.01 seconds range
min: 0, max: 15, avg: 0.52 (95 samples) -- 1.01 seconds range
min: 0, max: 4, avg: 0.48 (94 samples) -- 1.00 seconds range
min: 0, max: 2, avg: 0.54 (94 samples) -- 1.00 seconds range
min: 0, max: 1, avg: 0.38 (96 samples) -- 1.01 seconds range
min: 0, max: 8, avg: 0.55 (94 samples) -- 1.00 seconds range
文件中:
main.cpp
我还在#include <pocketsphinx.h>
#define MODELDIR "/usr/local/share/pocketsphinx/model"
int main(int argc, char* argv[])
{
ps_decoder_t *ps = nullptr;
cmd_ln_t *config = nullptr;
config = cmd_ln_init(NULL, ps_args(), TRUE,
"-hmm", MODELDIR "/en-us/en-us",
"-lm", MODELDIR "/en-us/en-us.lm.bin",
"-dict", MODELDIR "/en-us/cmudict-en-us.dict",
NULL);
}
文件中添加了以下行:
.pro
当我尝试构建时,出现以下错误:
INCLUDEPATH += /usr/local/include/sphinxbase
INCLUDEPATH += /usr/local/include/pocketsphinx
ps_args
我在Debian 8.我错过了什么?
答案 0 :(得分:0)
好吧,所以这看起来很傻,但我终于解决了这个问题,我希望这可以帮助将来在Qt中遇到类似错误的任何人。
解决方法是右键单击编辑器中的任意位置,然后单击“添加库”,再选择“系统库”。然后我输入了库名,在我的例子中是pocketsphinx
。我重复了sphinxbase
。然后转到Build - Run qmake,然后构建。