freeswitch pocketsphinx:安装模型语言

时间:2017-01-04 10:14:49

标签: cmusphinx freeswitch sphinx4 pocketsphinx

我正在使用带有pocketsphinx的freeswitch进行语音检测,当我在语法文件中使用英语时,它工作正常,但现在我想使用法语,我已经从https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French/下载了法语模型然后我提取了cmusphinx freeswitch / grammar / model / fr /中的-fr-ptm-5.2.tar.gz文件和freeswitch中的fr.dict / grammar /

这是conf / autoload_configs / pocketsphinx.conf.xml:

<configuration name="pocketsphinx.conf" description="PocketSphinx ASR Configuration">
  <settings>
    <param name="threshold" value="400"/>
    <param name="silence-hits" value="25"/>
    <param name="listen-hits" value="1"/>
    <param name="auto-reload" value="true"/>
    <!--<param name="language-weight" value="1"/>-->
    <param name="narrowband-model" value="fr"/>
    <!--<param name="wideband-model" value="wsj1"/>-->
    <param name="dictionary" value="fr.dict"/>
  </settings>
</configuration>
问题是,在尝试加载语法文件时,freeswitch被阻止: 这是日志:

break=on-false
    Dialplan: sofia/internal/abdofariss@sip.linphone.org parsing [default->vidson_ivr] continue=false
    Dialplan: sofia/internal/abdofariss@sip.linphone.org Regex (PASS) [vidson_ivr] destination_number(vidson) =~ /^vidson$/ break=on-false
    Dialplan: sofia/internal/abdofariss@sip.linphone.org Action javascript(vidson.js)
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:286 (sofia/internal/abdofariss@sip.linphone.org) State Change CS_ROUTING -> CS_EXECUTE
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:643 (sofia/internal/abdofariss@sip.linphone.org) State ROUTING going to sleep
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/abdofariss@sip.linphone.org) Running State Change CS_EXECUTE (Cur 1 Tot 1)
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:650 (sofia/internal/abdofariss@sip.linphone.org) State EXECUTE
    2017-01-03 18:36:39.106882 [DEBUG] mod_sofia.c:200 sofia/internal/abdofariss@sip.linphone.org SOFIA EXECUTE
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:328 sofia/internal/abdofariss@sip.linphone.org Standard EXECUTE
    EXECUTE sofia/internal/abdofariss@sip.linphone.org set(open=true)
    2017-01-03 18:36:39.106882 [DEBUG] mod_dptools.c:1562 SET sofia/internal/abdofariss@sip.linphone.org [open]=[true]
    EXECUTE sofia/internal/abdofariss@sip.linphone.org hash(insert/164.132.197.182-spymap/abdofariss/31da341e-f146-4239-94f8-1966bbb3c96d)
    EXECUTE sofia/internal/abdofariss@sip.linphone.org hash(insert/164.132.197.182-last_dial/abdofariss/vidson)
    EXECUTE sofia/internal/abdofariss@sip.linphone.org hash(insert/164.132.197.182-last_dial/global/31da341e-f146-4239-94f8-1966bbb3c96d)
    EXECUTE sofia/internal/abdofariss@sip.linphone.org export(RFC2822_DATE=Tue, 03 Jan 2017 18:36:39 +0100)
    2017-01-03 18:36:39.106882 [DEBUG] switch_channel.c:1296 EXPORT (export_vars) [RFC2822_DATE]=[Tue, 03 Jan 2017 18:36:39 +0100]
    EXECUTE sofia/internal/abdofariss@sip.linphone.org javascript(vidson.js)
    2017-01-03 18:36:39.126878 [DEBUG] fsglobal.cpp:524 Loading XML
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [GSM:3:8000:20:13200:1]/[opus:116:48000:20:0:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [GSM:3:8000:20:13200:1]/[G722:9:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMU:0:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [GSM:3:8000:20:13200:1]/[PCMA:8:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [speex:110:8000:20:0:1]/[opus:116:48000:20:0:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [speex:110:8000:20:0:1]/[G722:9:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [speex:110:8000:20:0:1]/[PCMU:0:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [speex:110:8000:20:0:1]/[PCMA:8:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [iLBC:97:8000:30:0:1]/[opus:116:48000:20:0:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [iLBC:97:8000:30:0:1]/[G722:9:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [iLBC:97:8000:30:0:1]/[PCMU:0:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [iLBC:97:8000:30:0:1]/[PCMA:8:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[opus:116:48000:20:0:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[G722:9:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMA:8:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4843 Audio Codec Compare [PCMA:8:8000:20:64000:1] ++++ is saved as a match
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[opus:116:48000:20:0:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[G722:9:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMU:0:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4843 Audio Codec Compare [PCMU:0:8000:20:64000:1] ++++ is saved as a match
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4788 Audio Codec Compare [PCMU:0:8000:20:64000:1]/[PCMA:8:8000:20:64000:1]
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:4704 Set telephone-event payload to 101@8000
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:3385 Set Codec sofia/internal/abdofariss@sip.linphone.org PCMA/8000 20 ms 160 samples 64000 bits 1 channels
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_codec.c:111 sofia/internal/abdofariss@sip.linphone.org Original read codec set to PCMA:8
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:5047 Set telephone-event payload to 101@8000
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:5106 sofia/internal/abdofariss@sip.linphone.org Set 2833 dtmf send payload to 101 recv payload to 101
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7653 AUDIO RTP [sofia/internal/abdofariss@sip.linphone.org] 164.132.197.182 port 30020 -> 192.168.0.1 port 48260 codec: 8 ms: 20
    2017-01-03 18:36:39.126878 [DEBUG] switch_rtp.c:3888 Starting timer [soft] 160 bytes per 20ms
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7961 sofia/internal/abdofariss@sip.linphone.org Set 2833 dtmf send payload to 101
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7968 sofia/internal/abdofariss@sip.linphone.org Set 2833 dtmf receive payload to 101
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7991 sofia/internal/abdofariss@sip.linphone.org Set rtp dtmf delay to 40
    2017-01-03 18:36:39.126878 [NOTICE] sofia_media.c:92 Pre-Answer sofia/internal/abdofariss@sip.linphone.org!
    2017-01-03 18:36:39.126878 [DEBUG] switch_channel.c:3473 (sofia/internal/abdofariss@sip.linphone.org) Callstate Change RINGING -> EARLY
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7636 Audio params are unchanged for sofia/internal/abdofariss@sip.linphone.org.
    2017-01-03 18:36:39.126878 [DEBUG] mod_sofia.c:826 Local SDP sofia/internal/abdofariss@sip.linphone.org:
    v=0
    o=FreeSWITCH 1483434979 1483434980 IN IP4 164.132.197.182
    s=FreeSWITCH
    c=IN IP4 164.132.197.182
    t=0 0
    m=audio 30020 RTP/AVP 8 101
    a=rtpmap:8 PCMA/8000
    a=rtpmap:101 telephone-event/8000
    a=fmtp:101 0-16
    a=ptime:20
    a=sendrecv

    2017-01-03 18:36:39.126878 [DEBUG] sofia.c:7116 Channel sofia/internal/abdofariss@sip.linphone.org entering state [completed][200]
    2017-01-03 18:36:39.126878 [NOTICE] fssession.cpp:1168 Channel [sofia/internal/abdofariss@sip.linphone.org] has been answered
    2017-01-03 18:36:39.126878 [DEBUG] switch_channel.c:3772 (sofia/internal/abdofariss@sip.linphone.org) Callstate Change EARLY -> ACTIVE
    EXECUTE sofia/internal/abdofariss@sip.linphone.org set(tts_engine=cepstral)
    2017-01-03 18:36:39.126878 [DEBUG] mod_dptools.c:1562 SET sofia/internal/abdofariss@sip.linphone.org [tts_engine]=[cepstral]
    EXECUTE sofia/internal/abdofariss@sip.linphone.org set(tts_voice=isabel)
    2017-01-03 18:36:39.126878 [DEBUG] mod_dptools.c:1562 SET sofia/internal/abdofariss@sip.linphone.org [tts_voice]=[isabel]
    2017-01-03 18:36:39.126878 [DEBUG] fssession.cpp:980 Raw Codec Activation Success L16@8000hz 1 channel 20ms
    2017-01-03 18:36:39.126878 [DEBUG] switch_ivr_play_say.c:2693 Speaking text: Bienvenue sur la prise de rendez-vous téléphonique de Vidson-Medical
    2017-01-03 18:36:39.246877 [DEBUG] sofia.c:7116 Channel sofia/internal/abdofariss@sip.linphone.org entering state [ready][200]
    2017-01-03 18:36:39.986880 [INFO] switch_rtp.c:6957 Auto Changing audio port from 192.168.0.1:48260 to ip:48260
    2017-01-03 18:36:44.566901 [DEBUG] switch_rtp.c:7233 RTP RECV DTMF 1:960
    2017-01-03 18:36:44.566901 [INFO] switch_channel.c:515 RECV DTMF 1:960
    2017-01-03 18:36:44.566901 [DEBUG] switch_ivr_play_say.c:2871 done speaking text
    2017-01-03 18:36:44.666896 [DEBUG] switch_ivr_play_say.c:2693 Speaking text: Merci de sélectionner une action.
    2017-01-03 18:36:44.666896 [DEBUG] switch_ivr_play_say.c:2871 done speaking text
    2017-01-03 18:36:44.766896 [DEBUG] switch_ivr_play_say.c:2693 Speaking text: Pour prendre un rendez-vous, tapez 1
    2017-01-03 18:36:44.766896 [DEBUG] switch_ivr_play_say.c:2871 done speaking text
    2017-01-03 18:36:44.866885 [DEBUG] switch_ivr_play_say.c:2693 Speaking text: Pour annuler un rendez-vous, tapez 2
    2017-01-03 18:36:44.866885 [DEBUG] switch_ivr_play_say.c:2871 done speaking text
    2017-01-03 18:36:44.966881 [DEBUG] switch_ivr_play_say.c:2693 Speaking text: Pour joindre le secrétariat, tapez 3
    2017-01-03 18:36:44.966881 [DEBUG] switch_ivr_play_say.c:2871 done speaking text
你可以帮我安装模型吗?

1 个答案:

答案 0 :(得分:0)

对于电话质量,您需要下载我今天刚刚上传的8khz model

它不是很大,所以不要指望它非常准确。

要使用它,您需要将模型文件正确放入文件夹中,就像英文文件一样。然后它会工作。

确保使用最新的pocketsphinx。