简体   繁体   English

pocketsphinx python gstreamer音频速率

[英]pocketsphinx python gstreamer audio rate

I'm using pocketsphinx on linux, and I've been using the source code from the CMU tutorial. 我在Linux上使用pocketsphinx,并且一直在使用CMU教程中的源代码。 I'm trying to upload the HUB4 dictionary, language model, and acoustic model. 我正在尝试上传HUB4词典,语言模型和声学模型。

I had it working before when I just uploaded a dictionary and language model, but when I tried using the acoustic model I got this error: 我刚刚上载字典和语言模型之前就可以使用它,但是当我尝试使用声学模型时,出现此错误:

INFO: acmod.c(246): Parsed model-specific feature parameters from /home/mintea/programs/hub4/hub4opensrc.cd_continuous_8gau/feat.params FATAL_ERROR: "fe_sigproc.c", line 405: Failed to create filterbank, frequency range does not match. INFO:acmod.c(246):从/home/mintea/programs/hub4/hub4opensrc.cd_continuous_8gau/feat.params解析的特定于模型的特征参数FATAL_ERROR:“ fe_sigproc.c”,第405行:无法创建滤波器组,频率范围不匹配。 Sample rate 8000.000000, FFT size 512, lowerf 5734.375000 < freq -15.625000 > upperf 5078.125000. 采样率8000.000000,FFT大小为512,下限5734.375000 <频率-15.625000>上限5078.125000。

Here's a snippet of the code I'm using: 这是我正在使用的代码的片段:

self.pipeline = gst.parse_launch('gconfaudiosrc ! audioconvert ! audioresample '
                                     + '! vader name=vad auto-threshold=true '
                                     + '! pocketsphinx name=asr ! fakesink')

asr = self.pipeline.get_by_name('asr')
asr.connect('partial_result', self.asr_partial_result)
asr.connect('result', self.asr_result)
asr.set_property('hmm', '/home/mintea/programs/hub4/hub4opensrc.cd_continuous_8gau')
asr.set_property('lm', '/home/mintea/programs/hub4/language_model.arpaformat.DMP')
asr.set_property('dict', '/home/mintea/programs/hub4/cmudict.hub4.06d.dic')        
asr.set_property('configured', True)

I'm thinking there's a flag in the gst.parse_launch call that I configure for changing the audio rate, but I'm not quite sure how. 我想我在gst.parse_launch调用中配置了一个用于更改音频速率的标志,但是我不太确定该如何做。 Any suggestions? 有什么建议么? Thanks! 谢谢!

You can not use hub4 acoustic model with gstreamer plugin. 您不能通过gstreamer插件使用hub4声学模型。 It requires sample rate 16000 while sample rate 8000 is hardcoded in gstreamer plugin sources. 它要求采样率16000,而采样率8000在gstreamer插件源中进行硬编码。

You need to change 8000 to 16000 in multiple places in gstreamer plugin sources and recompile the plugin or you need to use 8khz acoustic models. 您需要在gstreamer插件源中的多个位置将8000更改为16000,然后重新编译该插件,或者您需要使用8khz声学模型。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Pocketsphinx + Gstreamer竞赛条件? Pocketsphinx无法在Python脚本中同时收听音频和录音吗? - Pocketsphinx + Gstreamer Race Condition? Pocketsphinx can't listen to audio + record from it at the same time in Python script? 在virtualenv中使用GStreamer和Python安装PocketSphinx - Installing PocketSphinx with GStreamer and Python in a virtualenv 如何在python中使用pocketphinx(5prealpha)和gstreamer-1.0? - How to use pocketsphinx (5prealpha) with gstreamer-1.0 in python? 配置PocketSphinx Gstreamer元素 - Configuring pocketsphinx gstreamer element 包括CMU Pocketsphinx gstreamer的语法 - Including a grammar with CMU pocketsphinx gstreamer Pocketsphinx python在遍历音频时不返回最后讲话 - Pocketsphinx python does not return last utterance while iterating over audio Python Wave音频采样率 - Python wave audio sample rate Python无法使用Gstreamer访问USB麦克风以在Raspberry Pi上使用Pocketsphinx执行语音识别 - Python having trouble accessing usb microphone using Gstreamer to perform speech recognition with Pocketsphinx on a Raspberry Pi 使用(Python)Gstreamer解码音频(转换为PCM数据) - Use (Python) Gstreamer to decode audio (to PCM data) 用于音频视频流的python gstreamer管道 - python gstreamer pipeline for audio video streaming
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM