speech recognition - Windows Phone 8 How to make SpeechRecognizerUI working better -
i used speechrecognizerui read user's voice input. expecting dollar amount $200 or $20.32 or $0.43 example. however, response backend "20 point 32" or "20 dot 32" or "zero point forty five. there better way use api samrtly can "200, 20.32, 0.45"? thanks!
you can load own grammar speechrecognizer described here: adding, loading, , preloading grammars windows phone 8.
in case useful srgs grammar.
you should create grammar (i microsoft speech example):
<grammar version="1.0" xml:lang="en-us" mode="voice" root="amount" xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0"> <rule id="amount"> <item repeat="1-3"> <ruleref uri="#number"/> </item> <item repeat="0-1"> <ruleref uri="#dot"/> <item> <item repeat="0-2"> <ruleref uri="#number"/> </item> </rule> <rule id="dot"> <one-of> <item> point <tag> out = "." ; </tag> </item> <item> dot <tag> out = "." ; </tag> </item> </one-of> </rule> <rule id="number"> <one-of> <item> 1 <tag> out = 1; </tag> </item> <item> 2 <tag> out = 2; </tag> </item> <item> 3 <tag> out = 3; </tag> </item> <item> 4 <tag> out = 4; </tag> </item> <item> 5 <tag> out = 5; </tag> </item> <item> 6 <tag> out = 6; </tag> </item> <item> 7 <tag> out = 7; </tag> </item> <item> 8 <tag> out = 8; </tag> </item> <item> 9 <tag> out = 9; </tag> </item> <item> ten <tag> out = 10; </tag> </item> </one-of> </rule> </grammar>
Comments
Post a Comment