2013-05-30 67 views
0

我在linux上使用pocketsphinx,我一直在使用CMU教程中的源代碼。我正在嘗試上傳HUB4詞典,語言模型和聲學模型。pocketsphinx python gstreamer音頻速率

我,當我剛剛上傳了詞典和語言模型,但是當我嘗試使用聲學模型,我得到這個錯誤之前的工作:

信息:acmod.c(246):解析的具體型號特徵來自/home/mintea/programs/hub4/hub4opensrc.cd_continuous_8gau/feat.params的參數 FATAL_ERROR:「fe_sigproc.c」,第405行:無法創建過濾器組,頻率範圍不匹配。採樣率8000.000000,FFT大小512,較低f 5734.375000 < freq -15.625000> upperf 5078.125000。

下面是我使用的代碼片段:

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) 

我想有一個在gst.parse_launch電話,我配置改變音頻速率的標誌,但我不是很當然如何。有什麼建議麼?謝謝!

回答

0

您不能將hub4聲學模型與gstreamer插件一起使用。它需要採樣率16000,而採樣率8000在gstreamer插件源中被硬編碼。

您需要在gstreamer插件源中的多個位置將8000更改爲16000,然後重新編譯該插件,或者需要使用8khz聲學模型。