【问题标题】:Cross compiling Sphinxbase and Pocketsphinx for ARM为 ARM 交叉编译 Sphinxbase 和 Pocketsphinx
【发布时间】:2018-07-31 10:39:21
【问题描述】:

我正在尝试让 Pocketsphinx 在基于 ARM 的处理器上工作以进行热词检测。所以我在 Ubuntu PC 上为 ARM 交叉编译 Sphinxbase 和 Pocketsphinx。我能够在 64 位 Ubuntu PC 上安装 Sphinxbase 和 Pocketsphinx 并使用以下命令使热词检测正常工作:

$./pocketsphinx_continuous -inmic yes -keyphrase “day” -kws_threshold 20

但我在交叉编译 Sphinxbase 时收到错误日志。我首先使用以下命令交叉编译 Sphinxbase。

$./autogen.sh

$./configure --host=arm-linux-gnueabihf --build=x86_64-linux-gnu --prefix=/home/rakesh/sphinx --without-python

上述命令的部分日志如下:

checking for pthread_create in -lpthread... yes
checking pulse/pulseaudio.h usability... no
checking pulse/pulseaudio.h presence... no
checking for pulse/pulseaudio.h... no
checking alsa/asoundlib.h usability... yes
checking alsa/asoundlib.h presence... yes
checking for alsa/asoundlib.h... yes
checking for snd_pcm_open in -lasound... no
checking for doxygen... no

当我发出 ma​​ke 命令时,我收到以下错误日志:

../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_any'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_sizeof'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_set_channels'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_set_rate_near'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_nonblock'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_drop'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_close'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_set_period_time_near'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_get_buffer_time_max'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_set_format'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_start'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_strerror'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_set_access'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_open'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_resume'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_readi'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_prepare'
../../src/libsphinxad/.libs/libsphinxad.so: undefined reference to `snd_pcm_hw_params_set_buffer_time_near'
collect2: error: ld returned 1 exit status
Makefile:413: recipe for target 'sphinx_cont_seg' failed
make[2]: *** [sphinx_cont_seg] Error 1
make[2]: Leaving directory '/home/rakesh/Sphinx/sphinxbase/src/sphinx_adtools'
Makefile:374: recipe for target 'all-recursive' failed
make[1]: *** [all-recursive] Error 1
make[1]: Leaving directory '/home/rakesh/Sphinx/sphinxbase/src'
Makefile:479: recipe for target 'all-recursive' failed
make: *** [all-recursive] Error 1

有人可以提出解决错误的解决方案吗?

【问题讨论】:

    标签: arm cross-compiling voice-recognition cmusphinx pocketsphinx


    【解决方案1】:

    根据他们在https://github.com/cmusphinx/pocketsphinx-android-demo 的示例Android 项目,他们为Android(即ARM)预构建的pocketsphinx 库与sphinxbase 链接在一起,但不包括与访问音频设备相关的方法,即ad_openad_start_recad_read .换句话说,他们的预建库需要在您选择的音频库的帮助下手动为pocketsphinx 提供音频样本。 在以下位置查看用于创建此“组合”版本库的源文件: https://github.com/cmusphinx/pocketsphinx-android/blob/master/CMakeLists.txt

    在构建 sphinxbase 时,脚本会尝试检测可用的音频库:https://github.com/cmusphinx/sphinxbase/blob/master/configure.ac#L118 您应该尝试将其强制为“无”,希望它仍能编译。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2019-05-21
      • 2011-07-24
      • 2014-12-05
      • 2012-08-04
      • 1970-01-01
      • 2023-03-16
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多