valid key with ask

12 views
Skip to first unread message

neera...@gmail.com

unread,
May 14, 2013, 10:00:54 AM5/14/13
to adhea...@googlegroups.com
 Is it possible to implement "valid keys" feature with ask , within current set of features

so if validkeys="123"  and limit=1

I can skip anything pressed other then "1" "2" or "3" within timeout values.   


ik

unread,
May 14, 2013, 10:32:46 AM5/14/13
to Adhearsion
it implies array, if you have it as a string, you can turn it to array like so: '123'.split




--
You received this message because you are subscribed to the Google Groups "Adhearsion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to adhearsion+...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

Ben Langfeld

unread,
May 14, 2013, 10:50:06 AM5/14/13
to adhea...@googlegroups.com
What you're asking for is hotword detection, which we do not currently support. Please feel free to file a feature request on github. Currently the Adhearsion-ASR plugin implements some of the things required for this, but does not do hotword detection, but rather will fire a nomatch if you go out of grammar.

Regards,
Ben Langfeld

neera...@gmail.com

unread,
May 14, 2013, 12:33:02 PM5/14/13
to adhea...@googlegroups.com
what about do block in 'ask' . Can I reset buffer metadata, so that for an invalid keypress  limit will still be applicable.

 validkeys = '123'
 ask limit:1 do |buffer|
    if validkeys.include? buffer[-1,1]
       # do something which will cease ask from exiting unless a valid key is pressed
    end
end

currenty this ask will exit with first press of any key.

Ben Langfeld

unread,
May 14, 2013, 1:25:17 PM5/14/13
to adhea...@googlegroups.com
This will match 1,2,3, otherwise throw a nomatch:

validkeys = '123'
ask limit: 1 do |buffer|
  validkeys.include? buffer
end

This is not hotword detection like I think you were asking for. It will not ignore other keypresses, it will terminate as a nomatch.

Regards,
Ben Langfeld


Reply all
Reply to author
Forward
0 new messages