freeswitch pocketsphinx: install model language

651 views Asked by At

i'm using freeswitch with pocketsphinx for speech detection, it's working fine when i use english in grammar files, but now i want to use french, i already downloaded the french model from https://sourceforge.net/projects/cmusphinx/files/Acoustic%20and%20Language%20Models/French/ then i extracted the cmusphinx-fr-ptm-5.2.tar.gz file in freeswitch/grammar/model/fr/ and the fr.dict in freeswitch/grammar/

this the 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>

the problem is that freeswitch is blocked when trying to load the grammar file: here are the logs:

break=on-false
    Dialplan: sofia/internal/[email protected] parsing [default->vidson_ivr] continue=false
    Dialplan: sofia/internal/[email protected] Regex (PASS) [vidson_ivr] destination_number(vidson) =~ /^vidson$/ break=on-false
    Dialplan: sofia/internal/[email protected] Action javascript(vidson.js)
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:286 (sofia/internal/[email protected]) State Change CS_ROUTING -> CS_EXECUTE
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:643 (sofia/internal/[email protected]) State ROUTING going to sleep
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:584 (sofia/internal/[email protected]) 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/[email protected]) State EXECUTE
    2017-01-03 18:36:39.106882 [DEBUG] mod_sofia.c:200 sofia/internal/[email protected] SOFIA EXECUTE
    2017-01-03 18:36:39.106882 [DEBUG] switch_core_state_machine.c:328 sofia/internal/[email protected] Standard EXECUTE
    EXECUTE sofia/internal/[email protected] set(open=true)
    2017-01-03 18:36:39.106882 [DEBUG] mod_dptools.c:1562 SET sofia/internal/[email protected] [open]=[true]
    EXECUTE sofia/internal/[email protected] hash(insert/164.132.197.182-spymap/abdofariss/31da341e-f146-4239-94f8-1966bbb3c96d)
    EXECUTE sofia/internal/[email protected] hash(insert/164.132.197.182-last_dial/abdofariss/vidson)
    EXECUTE sofia/internal/[email protected] hash(insert/164.132.197.182-last_dial/global/31da341e-f146-4239-94f8-1966bbb3c96d)
    EXECUTE sofia/internal/[email protected] 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/[email protected] 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/[email protected] 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/[email protected] 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/[email protected] 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/[email protected]] 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/[email protected] Set 2833 dtmf send payload to 101
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7968 sofia/internal/[email protected] Set 2833 dtmf receive payload to 101
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7991 sofia/internal/[email protected] Set rtp dtmf delay to 40
    2017-01-03 18:36:39.126878 [NOTICE] sofia_media.c:92 Pre-Answer sofia/internal/[email protected]!
    2017-01-03 18:36:39.126878 [DEBUG] switch_channel.c:3473 (sofia/internal/[email protected]) Callstate Change RINGING -> EARLY
    2017-01-03 18:36:39.126878 [DEBUG] switch_core_media.c:7636 Audio params are unchanged for sofia/internal/[email protected].
    2017-01-03 18:36:39.126878 [DEBUG] mod_sofia.c:826 Local SDP sofia/internal/[email protected]:
    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/[email protected] entering state [completed][200]
    2017-01-03 18:36:39.126878 [NOTICE] fssession.cpp:1168 Channel [sofia/internal/[email protected]] has been answered
    2017-01-03 18:36:39.126878 [DEBUG] switch_channel.c:3772 (sofia/internal/[email protected]) Callstate Change EARLY -> ACTIVE
    EXECUTE sofia/internal/[email protected] set(tts_engine=cepstral)
    2017-01-03 18:36:39.126878 [DEBUG] mod_dptools.c:1562 SET sofia/internal/[email protected] [tts_engine]=[cepstral]
    EXECUTE sofia/internal/[email protected] set(tts_voice=isabel)
    2017-01-03 18:36:39.126878 [DEBUG] mod_dptools.c:1562 SET sofia/internal/[email protected] [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/[email protected] 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

can you help me install the model please ?

1

There are 1 answers

0
Nikolay Shmyrev On

For telephone quality you need to download 8khz model I have just uploaded today.

It is not very big, so do not expect it to be extremely accurate.

To use it you need to properly put the model files in the folder, just like english files. Then it will work.

Make sure you are using latest pocketsphinx.