<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; charset=iso-8859-1">
<META NAME="Generator" CONTENT="MS Exchange Server version 6.5.7654.12">
<TITLE>RE: [Freeswitch-users] How to implement TTS barge-in using FS ESL</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/plain format -->
<P><FONT SIZE=2>Great work, thanks Christopher!<BR>
<BR>
I've quick tested it from the dialplan based on the example. It works on my setup.<BR>
<BR>
Now I am trying to put it into my Java ESL app, FS complains:<BR>
<BR>
switch_ivr_play_say.c:1167 Invalid Args<BR>
<BR>
A piece of codes I am using:<BR>
<BR>
SendMsg msg = new SendMsg();<BR>
msg.addCallCommand("execute");<BR>
msg.addExecuteAppName("play_and_detect_speech");<BR>
String arg = "say:" + utt + " detect:unimrcp:nuance5-mrcp1-1 {start-input-timers=false,no-input-timeout=5000,"<BR>
+ "recognition-timeout=5000}" +this.crntGrammar;<BR>
msg.addExecuteAppArg(arg);<BR>
EslMessage response = sendSyncMultiLineCommand(channel, msg.getMsgLines());<BR>
<BR>
Is there something I am missing?<BR>
<BR>
Cheers,<BR>
<BR>
Xing<BR>
<BR>
<BR>
<BR>
-----Original Message-----<BR>
From: freeswitch-users-bounces@lists.freeswitch.org on behalf of Christopher Rienzo<BR>
Sent: Tue 11/15/2011 20:05<BR>
To: FreeSWITCH Users Help<BR>
Subject: Re: [Freeswitch-users] How to implement TTS barge-in using FS ESL<BR>
<BR>
Latest version of FreeSWITCH now has<BR>
<A HREF="http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_detect_speech">http://wiki.freeswitch.org/wiki/Misc._Dialplan_Tools_play_and_detect_speech</A><BR>
Give it a try and let us know if there is anything that can be improved.<BR>
<BR>
<BR>
<BR>
On Mon, Nov 14, 2011 at 12:06 PM, xl127 <x.liu@hw.ac.uk> wrote:<BR>
<BR>
> The way you did and described here is similar to what I wanted.<BR>
> I want to set start-input-timers=false in the initial setup, then start<BR>
> the recognition timer once the TTS finishes playing the prompt.<BR>
> I do not use input callback as I am using ESL event (Java ESL Client<BR>
> 0.9.2).<BR>
><BR>
> I've not yet figured out how to know the prompt playing has finished, how<BR>
> to stop the TTS and how to start the input timer.<BR>
> I didn't get many events when I did barge-in: only got two CHANNEL_EXECUTE<BR>
> and CAHNNEL_EXECUTE_COMPLETE events.<BR>
> so didn't get the DETECTED_SPEECH at this point.<BR>
><BR>
> In principle it shouldn't stop FS generating events when barging in, so<BR>
> there must be somethings wrong in my setup.<BR>
><BR>
> From Examples_directory_lua_asr_tts in the wiki, it mentions the session<BR>
> needs to sleep for a few seconds before getting the results.<BR>
> I tried but it didn't help.<BR>
><BR>
><BR>
><BR>
><BR>
> On 14/11/11 14:48, Christopher Rienzo wrote:<BR>
><BR>
> I'm not sure why it locks up for you. It works for me and I know of at<BR>
> least one other developer that got it all to work.<BR>
><BR>
> The way I do it in my custom APP is to set {start-input-timers=false} in<BR>
> the speech recognition request and register an input callback function to<BR>
> deal with the recognition and DTMF events. The input callback reacts to<BR>
> the start of speech and recognition complete events by stopping the<BR>
> prompt. At start of speech, the input timers are started and silence is<BR>
> played until the final result arrives from the recognizer (no match, match,<BR>
> etc).<BR>
><BR>
> An alternative way to do this is to watch for the recognition events over<BR>
> ESL and react to them.<BR>
><BR>
><BR>
><BR>
> On Mon, Nov 14, 2011 at 9:19 AM, xl127 <x.liu@hw.ac.uk> wrote:<BR>
><BR>
>> Hi Christopher,<BR>
>><BR>
>> That will be great! Thanks and looking forward to your app!<BR>
>><BR>
>> By the way, do you have a quick thoughts about the reasons the FS stucks<BR>
>> when garge-in occurs?<BR>
>> Otherwise if it is not straightforward to explain it, just leave it<BR>
>> alone until your new app comes out.<BR>
>><BR>
>> Cheers,<BR>
>> Xing<BR>
>><BR>
>><BR>
>><BR>
>><BR>
>> On 14/11/11 13:23, Christopher Rienzo wrote:<BR>
>><BR>
>> I'll write up a dialplan app this week to deal with this. Getting tired<BR>
>> of being asked the same question over and over since it's too complicated<BR>
>> as is currently designed :)<BR>
>><BR>
>><BR>
>><BR>
>><BR>
>> On Mon, Nov 14, 2011 at 8:07 AM, xl127 <x.liu@hw.ac.uk> wrote:<BR>
>><BR>
>>> Hi,<BR>
>>><BR>
>>> The first problem I need to solve is that FS stucks when I speak during<BR>
>>> the prompt is playing.<BR>
>>> It looks like the recognizer is not listening any more. It works fine if<BR>
>>> I speak after the playing prompt finishes.<BR>
>>><BR>
>>> I tried Nuance and PocketSphinx recognizers and got same problem.<BR>
>>><BR>
>>> Any idea about what the possible causes are?<BR>
>>><BR>
>>> Thanks!<BR>
>>> Xing<BR>
>>><BR>
>>><BR>
>>> On 11/11/11 18:59, xl127 wrote:<BR>
>>> > Hello,<BR>
>>> ><BR>
>>> > I found this is a question that was asked before by others, but I<BR>
>>> didn't<BR>
>>> > find the answer.<BR>
>>> ><BR>
>>> > Anyway, I am using FS ESL outbound mode connecting to my IVR app,<BR>
>>> using<BR>
>>> > FS's "speak"<BR>
>>> > and "detect_speech" to access Nuance MRCP V1 server.<BR>
>>> ><BR>
>>> > I want the user to be able to barge-in during the system's speaking.<BR>
>>> > How could I implement it?<BR>
>>> ><BR>
>>> > I tried to specify "kill-on-barge-in=true" in the mrcp config profile.<BR>
>>> > The barge-in doesn't work.<BR>
>>> ><BR>
>>> > With or without setting kill-on-barge-in, FS stops responding to my<BR>
>>> > phone call and<BR>
>>> > eventually it hangs up my call if I speak somthing (do the barge-in)<BR>
>>> > during the system's speaking.<BR>
>>> ><BR>
>>> > I made a turn-by-turn loop in my app, the ASR/TTS works fine if I do<BR>
>>> not<BR>
>>> > do barge-in ( I wait until the TTS finishes then I start to speak)<BR>
>>> ><BR>
>>> > Any advices please?<BR>
>>> ><BR>
>>> > Thanks!<BR>
>>> > Xing<BR>
>>> ><BR>
>>> ><BR>
>>> ><BR>
>>><BR>
>>><BR>
>>><BR>
>>> --<BR>
>>> Heriot-Watt University is a Scottish charity<BR>
>>> registered under charity number SC000278.<BR>
>>><BR>
>>> Heriot-Watt University is the Sunday Times<BR>
>>> Scottish University of the Year 2011-2012<BR>
>>><BR>
>>><BR>
>>><BR>
>>> _________________________________________________________________________<BR>
>>> Professional FreeSWITCH Consulting Services:<BR>
>>> consulting@freeswitch.org<BR>
>>> <A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A><BR>
>>><BR>
>>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
>>> <A HREF="http://www.cudatel.com">http://www.cudatel.com</A><BR>
>>><BR>
>>> Official FreeSWITCH Sites<BR>
>>> <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
>>> <A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A><BR>
>>> <A HREF="http://www.cluecon.com">http://www.cluecon.com</A><BR>
>>><BR>
>>> FreeSWITCH-users mailing list<BR>
>>> FreeSWITCH-users@lists.freeswitch.org<BR>
>>> <A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
>>> UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
>>> <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
>>><BR>
>><BR>
>><BR>
>><BR>
>> _________________________________________________________________________<BR>
>> Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com<BR>
>><BR>
>> FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com<BR>
>><BR>
>> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com<BR>
>><BR>
>> FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>
>> UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org">http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org</A><BR>
>><BR>
>><BR>
>><BR>
>> ------------------------------<BR>
>><BR>
>> [image: Scottish University of the Year 2011-12] *Heriot-Watt<BR>
>> University is the Sunday Times<BR>
>><BR>
>> Scottish University of the Year 2011-2012<BR>
>> *<BR>
>><BR>
>> Heriot-Watt University is a Scottish charity<BR>
>> registered under charity number SC000278.<BR>
>><BR>
>> _________________________________________________________________________<BR>
>> Professional FreeSWITCH Consulting Services:<BR>
>> consulting@freeswitch.org<BR>
>> <A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A><BR>
>><BR>
>> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
>> <A HREF="http://www.cudatel.com">http://www.cudatel.com</A><BR>
>><BR>
>> Official FreeSWITCH Sites<BR>
>> <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
>> <A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A><BR>
>> <A HREF="http://www.cluecon.com">http://www.cluecon.com</A><BR>
>><BR>
>> FreeSWITCH-users mailing list<BR>
>> FreeSWITCH-users@lists.freeswitch.org<BR>
>> <A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
>> UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
>> <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
>><BR>
>><BR>
><BR>
><BR>
> _________________________________________________________________________<BR>
> Professional FreeSWITCH Consulting Services:consulting@freeswitch.orghttp://www.freeswitchsolutions.com<BR>
><BR>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Serverhttp://www.cudatel.com<BR>
><BR>
> Official FreeSWITCH Siteshttp://www.freeswitch.orghttp://wiki.freeswitch.orghttp://www.cluecon.com<BR>
><BR>
> FreeSWITCH-users mailing listFreeSWITCH-users@lists.freeswitch.orghttp://lists.freeswitch.org/mailman/listinfo/freeswitch-users<BR>
> UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org">http://lists.freeswitch.org/mailman/options/freeswitch-usershttp://www.freeswitch.org</A><BR>
><BR>
><BR>
><BR>
> ------------------------------<BR>
><BR>
> [image: Scottish University of the Year 2011-12] *Heriot-Watt<BR>
> University is the Sunday Times<BR>
> Scottish University of the Year 2011-2012*<BR>
><BR>
> Heriot-Watt University is a Scottish charity<BR>
> registered under charity number SC000278.<BR>
><BR>
> _________________________________________________________________________<BR>
> Professional FreeSWITCH Consulting Services:<BR>
> consulting@freeswitch.org<BR>
> <A HREF="http://www.freeswitchsolutions.com">http://www.freeswitchsolutions.com</A><BR>
><BR>
> FreeSWITCH-powered IP PBX: The CudaTel Communication Server<BR>
> <A HREF="http://www.cudatel.com">http://www.cudatel.com</A><BR>
><BR>
> Official FreeSWITCH Sites<BR>
> <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
> <A HREF="http://wiki.freeswitch.org">http://wiki.freeswitch.org</A><BR>
> <A HREF="http://www.cluecon.com">http://www.cluecon.com</A><BR>
><BR>
> FreeSWITCH-users mailing list<BR>
> FreeSWITCH-users@lists.freeswitch.org<BR>
> <A HREF="http://lists.freeswitch.org/mailman/listinfo/freeswitch-users">http://lists.freeswitch.org/mailman/listinfo/freeswitch-users</A><BR>
> UNSUBSCRIBE:<A HREF="http://lists.freeswitch.org/mailman/options/freeswitch-users">http://lists.freeswitch.org/mailman/options/freeswitch-users</A><BR>
> <A HREF="http://www.freeswitch.org">http://www.freeswitch.org</A><BR>
><BR>
><BR>
<BR>
</FONT>
</P>
<br>
<hr>
<br>
<img src="cid:hw_uni_of_year.jpg" align=left
alt="Scottish University of the Year 2011-12">
<font face="arial,helvetica">
<b>Heriot-Watt University is the Sunday Times<br>
Scottish University of the Year 2011-2012</b>
</font>
<br><br>
<font face="arial,helvetica" size="-1">
Heriot-Watt University is a Scottish charity<br>
registered under charity number SC000278.
<br>
</font>
</BODY>
</HTML>