9

In using PromptBuilder for various things, I've hit a deadend with respect to spoken numbers. When the user is asked how much they paid for something, and they say, "50" (yes, just "50", not "50 dollars"), the value that I get back is "fifty" and not "50".

When I am expecting a number, how can I make sure the result I get will be an actual number, and not its equivalent word?

uSeRnAmEhAhAhAhAhA
  • 2,527
  • 6
  • 39
  • 64
  • 4
    Don't you mean: '... is "fifty" and not "50".'? – Abbas Sep 26 '13 at 10:58
  • What the hell!? I don't remember making that many mistakes lol. Sorry, I will fix this. Fixed. Thank you. – uSeRnAmEhAhAhAhAhA Sep 26 '13 at 11:06
  • Don't know if it's in WP8, but do you need to create a CreateDigitsGrammar object (http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammar.priority.aspx) – Neil Sep 26 '13 at 11:17
  • 1
    A patch rather than a solution: http://stackoverflow.com/questions/11278081/convert-words-string-to-int – spender Sep 26 '13 at 11:19
  • 1
    I'm not sure whether or not this would work for Win8, but I am using a dictation grammer (although this costs a lot in terms of resources), and when I say '50', the number rather than the word is printed in my richtextbox. Although it would probably be more cost effective to use the CreateDigitsGrammar suggested by Neil. You could also add your own custom grammar, and in the recognizer_SpeechRecognized EventHandler, you can set a value of a textbox to whatever value you see fit (Or use SendKeys to send the text to a form or whatever). – John Bartels Oct 06 '13 at 22:28
  • Does this happen to any other values? Like let say 20 and giving u "twenty" ? Because i used textrecognition for win7 and what I created was my own text relation, something like an ORM but for textrecognition vrd text. – S.H. Nov 10 '13 at 02:30

1 Answers1

0

Well i would suggest you to use google voice search api instead of this.Ofcourse google search api is an unofficial one its reversed engineered so if u want to use it for official use then i would recommend not to use it but if u dont care like me then go ahead. Accessing google speech api This is link for how to do this.Unlike microsoft.speech, google speech requires internet for recognition and its little tricky to integrate but onces done it gives 100% results.

ansh shah
  • 31
  • 5