<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0cm;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:#0563C1;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:#954F72;
        text-decoration:underline;}
code
        {mso-style-priority:99;
        font-family:"Courier New";}
span.EmailStyle17
        {mso-style-type:personal-compose;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;
        mso-fareast-language:EN-US;}
@page WordSection1
        {size:612.0pt 792.0pt;
        margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-AU" link="#0563C1" vlink="#954F72">
<div class="WordSection1">
<p class="MsoNormal">To FreeSWITCH users,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I am about to experiment with Speech Recognition inside FreeSWITCH and seem to have hit a wall.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">After building FreeSWITCH 1.6.13 with asr_tts/mod_pocketsphinx uncommented successfully.<o:p></o:p></p>
<p class="MsoNormal">Then uncommenting from autoload_configs/modules.conf.xml &lt;load module=&#8221;mod_pocketsphinx/&gt;.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Then trying to run the pizza demo from the old Wiki: <a href="https://wiki.freeswitch.org/wiki/Mod_pocketsphinx">
https://wiki.freeswitch.org/wiki/Mod_pocketsphinx</a><o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I get the following:<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">&#8230;<o:p></o:p></p>
<p class="MsoNormal">EXECUTE sofia/internal/1000@192.168.15.50:5080 detect_speech(pocketsphinx pizza_order&nbsp; undefined)<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.345674 [DEBUG] switch_core_media_bug.c:828 Attaching BUG to sofia/internal/1000@192.168.15.50:5080<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.345674 [WARNING] mod_pocketsphinx.c:172 Can't open speech model /usr/local/freeswitch/grammar/model/wsj1.<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.345674 [DEBUG] switch_ivr_async.c:4800 Error loading Grammar<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.345674 [INFO] mod_pocketsphinx.c:257 Port Closed.<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.345674 [DEBUG] switch_core_media_bug.c:1190 Removing BUG from sofia/internal/1000@192.168.15.50:5080<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.366177 [CRIT] SpeechTools.jm:213 ----ERROR:<o:p></o:p></p>
<p class="MsoNormal">ReferenceError: XML is not defined<o:p></o:p></p>
<p class="MsoNormal">EXECUTE sofia/internal/1000@192.168.15.50:5080 detect_speech(resume)<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.865609 [DEBUG] switch_core_file.c:334 File /usr/local/freeswitch/sounds/en/us/callie/pizza/GP-DeliveryorTakeout.wav sample rate 8000 doesn't match requested rate 16000<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:16.865609 [DEBUG] switch_ivr_play_say.c:1468 Codec Activated L16@16000hz 1 channels 20ms<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:19.585569 [DEBUG] switch_ivr_play_say.c:1911 done playing file /usr/local/freeswitch/sounds/en/us/callie/pizza/GP-DeliveryorTakeout.wav<o:p></o:p></p>
<p class="MsoNormal">EXECUTE sofia/internal/1000@192.168.15.50:5080 detect_speech(resume)<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:21.245871 [NOTICE] sofia.c:1011 Hangup sofia/internal/1000@192.168.15.50:5080 [CS_EXECUTE] [NORMAL_CLEARING]<o:p></o:p></p>
<p class="MsoNormal">2016-12-12 14:07:21.245871 [ERR] SpeechTools.jm:472 Exception: Session is not active! (near: &quot;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; rv = this.asr.session.collectInput(this.asr.onInput, this.asr, 1000);&quot;)<br>
&#8230;<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">I noticed that there is no grammar model &#8220;wsj1&#8221; inside /usr/local/freeswitch/grammar/model<o:p></o:p></p>
<p class="MsoNormal">Also I cannot find wsj1 anywhere from the src or freeswitch files online.&nbsp; Does anyone have a tar.gz version of this?&nbsp; So at least I can get past this issue.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Then I decided to follow the Lua directory example: <a href="https://freeswitch.org/confluence/display/FREESWITCH/Lua&#43;ASR&#43;TTS&#43;Directory&#43;Example">
https://freeswitch.org/confluence/display/FREESWITCH/Lua&#43;ASR&#43;TTS&#43;Directory&#43;Example</a><o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">About half way down it states: <o:p></o:p></p>
<p class="MsoNormal">==========================================<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Next we create our dictionary and language model file. Change your directory to /usr/local/freeswitch/grammar and create a file called directory.sent<o:p></o:p></p>
<p class="MsoNormal">We are using Matthew Williams and Joe Smith as our examples.<o:p></o:p></p>
<p class="MsoNormal">&lt;s&gt; MATTHEW_WILLIAMS &lt;/s&gt;<o:p></o:p></p>
<p class="MsoNormal">&lt;s&gt; MATT_WILLIAMS &lt;/s&gt;<o:p></o:p></p>
<p class="MsoNormal">&lt;s&gt; JOSEPH_SMITH &lt;/s&gt;<o:p></o:p></p>
<p class="MsoNormal">&lt;s&gt; JOE_SMITH &lt;/s&gt;<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Type make in the /usr/local/freeswitch/grammar directory.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">This should give you the following files.<o:p></o:p></p>
<p class="MsoNormal">ls -la directory<o:p></o:p></p>
<p class="MsoNormal">-rw-r--r--&nbsp; 1 root root&nbsp;&nbsp; 82 2008-08-13 10:59 directory.dic<o:p></o:p></p>
<p class="MsoNormal">-rw-r--r--&nbsp; 1 root root&nbsp; 727 2008-08-13 10:59 directory.lm<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">This does not work since the &#8220;make&#8221; does not work here!<o:p></o:p></p>
<p class="MsoNormal"><o:p></o:p></p>
<p class="MsoNormal">Any ideas?<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">So far not much luck.&nbsp; I understand that pocketsphinx is not really a production product, however my client would like to make use of it for internal testing only.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Any assistance would be great.<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Thanks in advance,<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
<p class="MsoNormal">Andrew Keil<o:p></o:p></p>
<p class="MsoNormal"><o:p>&nbsp;</o:p></p>
</div>
</body>
</html>