为 Linux 安装 PocketSphinx 创建模块?

Create modules for Linux install of PocketSphinx?

我正在尝试让 Python 3.4 在 Linux (Ubuntu 14.04 OS) 机器上使用 PocketSphinx。昨天,我成功安装了 sphinxbase-5prealphapocketsphinx-5prealpha。我通过成功 运行 pocketsphinx_continuous -inmic yes

确认了我的安装

我正在尝试继续 Python API 但找不到 python 模块(sphinxbasepocketsphinx)我目录中的任何位置。我在网上搜索但只能找到与 Windows 安装相关的 installing/creating 一个 pocketsphinx 文件的引用。

如何在我的 Linux 安装中创建模块 sphinxbasepocketsphinx?相对于 ../MySphinxDirectory,他们应该住在哪里?

您可以通过 pip 为 pocketsphinxsphinxbase 安装 python 模块。

就运行:

sudo pip install pocketsphinx

sphinxbase 模块是 pocketsphinx 的要求,因此它会在您安装 pocketsphinx 软件包时自动安装。

然后在您的 python 程序中,您应该能够使用以下方法从它们导入模块:

from pocketsphinx.pocketsphinx import ...
from sphinxbase.sphinxbase import ...

pocketsphinx repository includes an example you can test with 如果您还没有。