Click here to Skip to main content
15,891,567 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hello it's my code !

SpeechRecognitionEngine sre = new SpeechRecognitionEngine();
Grammar gr = new DictationGrammar();
sre.LoadGrammar(gr);

but i want it's convert audio to numbers only not string

i hope somebody helping me

Thx

What I have tried:

C#
using System.Speech.Recognition;
Posted
Updated 14-Oct-16 14:40pm

1 solution

You get a string no matter what. You don't get to choose the output format. You CAN however, convert the output string to a number quite easily with Int.TryParse if the string contains numbers or you can parse the string for the words representing the number(s).
 
Share this answer
 
Comments
Mohammed Fahmy 16-Oct-16 6:26am    
i think u are wrong , it's back to grammar but idk how to made it :(
Dave Kreskowiak 16-Oct-16 9:27am    
I quote:
"but i want it's convert audio to numbers only not string".

There two ways to interpret that. Both have the same answer. You do not get to pick how the data is returned to you. You have to parse it for what you need.
Mohammed Fahmy 16-Oct-16 9:58am    
thxz for answer it's not back to it , if i load grammar from xml numbers only it's mean out numbers only but idk how to load xml with numbers only
Dave Kreskowiak 16-Oct-16 11:33am    
So you're really looking for a tutorial on building a grammar?

https://msdn.microsoft.com/en-us/library/office/hh538495(v=office.14).aspx
Mohammed Fahmy 16-Oct-16 13:12pm    
thanks ,so much some hting liek that but the point i use it and speech don't catch number at string well :( example we have at adio
one-two-three
he catch :iran the l
that's really my point :( i hope you can help me

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900