[Freeswitch-users] Speech recognition SpeechTools.jm Error
Gonzalo Gasca Meza
gascagonzalo at gmail.com
Wed Jan 11 10:48:02 MSK 2017
Sigh...
Need to confirm if this SpeechRecognition.jm script needs to be migrated to
XML handling based on this note:
"The new V8 module relies on XML support built into FS, since Google V8
doesn't have this built-in like Spidermonkey."
https://freeswitch.org/confluence/display/FREESWITCH/JavaScript+example+-+XML
http://stackoverflow.com/questions/38846047/freeswitch-speech-recognition-speechtools-jm-error?rq=1
Seems to be that handling XML
<result grammar="pizza_order">
<interpretation grammar="pizza_order" confidence="100">
<input mode="speech">pickup</input>
</interpretation>
</result>
Require use of XML - use('XML'); as is not parsed by default, and original
.jm file may not work just using the original code.
Thanks
-Gonzalo
On Tue, Jan 10, 2017 at 10:10 PM, Артур <findmeinwland at gmail.com> wrote:
> You can debug it by yourself, print to console different values. Explore
> the code.
>
>
> 11.01.2017 11:07, Gonzalo Gasca Meza пишет:
>
> I renamed @confidence to confidence helped solving this specific issue
> but still getting errors when reading result.interpretation.
>
> 2017-01-11 00:52:52.739773 [DEBUG] mod_pocketsphinx.c:464 Recognized:
> takeout, Confidence: 99, Confidence-Threshold: 0
> 2017-01-11 00:52:52.759764 [DEBUG] SpeechTools.jm:188 ----XML:
>
> <result grammar="pizza_order">
> <interpretation grammar="pizza_order" confidence="99">
> <input mode="speech">takeout</input>
> </interpretation>
> </result>
>
> 2017-01-11 00:52:52.759764 [CRIT] SpeechTools.jm:214 ----ERROR:
> TypeError: Cannot read property 'interpretation' of undefined
> 2017-01-11 00:52:55.559759 [NOTICE] sofia.c:1011 Hangup sofia/external/
> 14088053951 at 104.236.190.206 [CS_EXECUTE] [NORMAL_CLEARING]
>
>
>
> On Tue, Jan 10, 2017 at 12:37 AM, Gonzalo Gasca Meza <
> gascagonzalo at gmail.com> wrote:
>
>> Code is from sample Grammar provided by Wiki, not my original code...
>>
>> On Tue, Jan 10, 2017 at 12:32 AM, Артур <findmeinwland at gmail.com> wrote:
>>
>>> But it's a syntax error, no? I think you need to verify your code
>>>
>>>
>>> 10.01.2017 13:26, Gonzalo Gasca Meza пишет:
>>> > Hi all,
>>> >
>>> > I'm trying to install Speech Recognition engine.
>>> >
>>> > Version: FreeSWITCH (Version 1.6.13 -21-e755b43 64bit)
>>> >
>>> > Following this example:
>>> >
>>> > https://wiki.freeswitch.org/wiki/Mod_pocketsphinx
>>> >
>>> > <include>
>>> > <extension name="pizza_demo">
>>> > <condition field="destination_number"
>>> expression="^(pizza|74992)$"/>
>>> > <condition field="${module_exists(mod_v8)}" expression="true"/>
>>> > <condition field="${module_exists(mod_pocketsphinx)}"
>>> > expression="true">
>>> > <action application="javascript" data="ps_pizza.js"/>
>>> > </condition>
>>> > </extension>
>>> > </include>
>>> >
>>> > I'm replacing mod_spidermonkey with mod_v8 based on this document and
>>> > when I call this number I get:
>>> >
>>> > EXECUTE sofia/external/14088053951 at 104.236.190.206
>>> > javascript(ps_pizza.js)
>>> > 2017-01-10 03:04:39.099748 [ERR] SpeechTools.jm:191 Exception:
>>> > SyntaxError: Unexpected identifier (near: "
>>> if
>>> > (result.interpretation. at confidence >= grammar_object.min_score) {")
>>> >
>>> > If I change: result.interpretation. at confidence to
>>> > result.interpretation.['@confidence']
>>> >
>>> > EXECUTE sofia/external/14088053951 at 104.236.190.206
>>> > export(RFC2822_DATE=Tue, 10 Jan 2017 03:13:10 -0500)
>>> > 2017-01-10 03:13:10.139816 [DEBUG] switch_channel.c:1296 EXPORT
>>> > (export_vars) [RFC2822_DATE]=[Tue, 10 Jan 2017 03:13:10 -0500]
>>> > EXECUTE sofia/external/14088053951 at 104.236.190.206
>>> > javascript(ps_pizza.js)
>>> > 2017-01-10 03:13:10.159763 [ERR] SpeechTools.jm:191 Exception:
>>> > SyntaxError: Unexpected string (near: "
>>> if
>>> > (result.interpretation.['@confidence'] >= grammar_object.min_score)
>>> {")
>>> >
>>> > SpeechTools.jm from:
>>> > https://raw.githubusercontent.com/lordnull/FreeSWITCH/master
>>> /scripts/javascript/js_modules/SpeechTools.jm
>>> >
>>> > Similar discussion:
>>> > http://lists.freeswitch.org/pipermail/freeswitch-users/2014-
>>> June/105818.html
>>> >
>>> > Any pointers?
>>> > I get the mod_v8 module compiled from Freeswitch using this:
>>> > https://freeswitch.org/confluence/display/FREESWITCH/mod_v8
>>> >
>>> > Thanks
>>> >
>>> >
>>> >
>>> >
>>> > ____________________________________________________________
>>> _____________
>>> > Professional FreeSWITCH Consulting Services:
>>> > consulting at freeswitch.org
>>> > http://www.freeswitchsolutions.com
>>> >
>>> > Official FreeSWITCH Sites
>>> > http://www.freeswitch.org
>>> > http://confluence.freeswitch.org
>>> > http://www.cluecon.com
>>> >
>>> > FreeSWITCH-users mailing list
>>> > FreeSWITCH-users at lists.freeswitch.org
>>> > http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> > UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/free
>>> switch-users
>>> > http://www.freeswitch.org
>>>
>>>
>>> ____________________________________________________________
>>> _____________
>>> Professional FreeSWITCH Consulting Services:
>>> consulting at freeswitch.org
>>> http://www.freeswitchsolutions.com
>>>
>>> Official FreeSWITCH Sites
>>> http://www.freeswitch.org
>>> http://confluence.freeswitch.org
>>> http://www.cluecon.com
>>>
>>> FreeSWITCH-users mailing list
>>> FreeSWITCH-users at lists.freeswitch.org
>>> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
>>> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
>>> http://www.freeswitch.org
>>>
>>
>>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services: consulting at freeswitch.orghttp://www.freeswitchsolutions.com
>
> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://confluence.freeswitch.orghttp://www.cluecon.com
>
> FreeSWITCH-users mailing listFreeSWITCH-users at lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org
>
>
>
> _________________________________________________________________________
> Professional FreeSWITCH Consulting Services:
> consulting at freeswitch.org
> http://www.freeswitchsolutions.com
>
> Official FreeSWITCH Sites
> http://www.freeswitch.org
> http://confluence.freeswitch.org
> http://www.cluecon.com
>
> FreeSWITCH-users mailing list
> FreeSWITCH-users at lists.freeswitch.org
> http://lists.freeswitch.org/mailman/listinfo/freeswitch-users
> UNSUBSCRIBE:http://lists.freeswitch.org/mailman/options/freeswitch-users
> http://www.freeswitch.org
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.freeswitch.org/pipermail/freeswitch-users/attachments/20170110/63604540/attachment-0001.html
Join us at ClueCon 2016 Aug 8-12, 2016
More information about the FreeSWITCH-users
mailing list