[英]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.