Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C#2.0
sir I'm doing project for my tyit in window application where user can speak any thing will get written on textbox but when I run my code I found accuracy problem ,is there any filter that only catch human voice or anti-noise or speech library in windows8 so I can use dll in my project.
Posted 22-Feb-13 10:21am
Edited 22-Feb-13 10:22am
v2

1 solution

Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

Big problem. I think technology is not quite there yet. Speech recognition based on a short grammar works reasonably well as soon as your English pronunciation is not too bad (actually, pronunciation makes big difference), but I find dictation, with the engine Microsoft provides these days, is practically useless. I would not rely on this possibility.
 
However, I heard there are commercial or experimental engines of much better quality, so even dictation accuracy is almost there. I never tried them myself, so I cannot say for sure. I guess, we will eventually have this opportunity with acceptable dictation qualify, but you never know exactly.
 
—SA
  Permalink  
Comments
depak gupta at 25-Feb-13 3:46am
   
Thanks sir for replying to my queries, but now I have tried tutorials in windows8 speech Recognition where I find till bit accuracy problem It's Ok, now can you suggest me idea how I can add the words so when user speak it gets written on richtextbox or textbox and written text will get dictated. e-mail id:deepakgupta10692@gmail.com
I'm making this kind of application so that handicapped can record any speech or may be lectures held in college so afterward they can hear the recordings.
if this is possible so please provide idea or else any alternative which can be good.
Thank in advance.
Sergey Alexandrovich Kryukov at 25-Feb-13 11:49am
   
Please see:
http://msdn.microsoft.com/en-us/library/system.speech.recognition.aspx
http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammarbuilder.aspx
http://msdn.microsoft.com/en-us/library/system.speech.recognition.grammar.aspx
 
and code sample.
 
The grammar for dictation is this:
http://msdn.microsoft.com/en-us/library/system.speech.recognition.dictationgrammar.aspx
but I never experienced acceptable quality with that, unfortunately.
 
Good luck, call again,
—SA
depak gupta at 26-Feb-13 10:33am
   
Thank's sir, once again you replied best sir below is my code where I have to manually add words in example.txt if there is any dictionary that I can add if it is possible then it will very thankful or can you improve this code where I can add dictation.
Thank's in advance.
Sergey Alexandrovich Kryukov at 26-Feb-13 12:06pm
   
Let me explain. Such dictionary already exists in the engine. The technology itself is based on the recognition of known words. The available dictation grammar is exactly this: it actually contains a big English dictionary in it. The problem is not the dictionary, but its size: I noticed that if you have your own grammar instance (see the articles referenced below: you create a grammar builder, add words or phrases to it, create a grammar), it works fine when there are only few distinctly different words in it. When you add few tens of words, the engine start mixing them up really badly (again, it also depends on your pronunciation, but if there are many words, it messes up even with perfect pronunciation). So, this is not a problem of the dictionary, this is a problem of technology. Unfortunately.
—SA
depak gupta at 27-Feb-13 15:23pm
   
Hello Sir,, then which technology will you recommend that can be good for my project or what are other possibilities I should follow to get out from it.
Thanks in Advance.
Sergey Alexandrovich Kryukov at 27-Feb-13 15:34pm
   
I only tried the engine supplied by Microsoft, usable according to the links provided above...
As I say, recognition based on a small dictionary was fine, but dictation was nearly hopeless. Try the newest version, maybe it's better. I'm afraid everything else would be commercial and expensive. Anyway, I did not try anything else...
—SA
depak gupta at 28-Feb-13 3:54am
   
Sir, recommend any Dictionary which Can be compatible with this or any idea by which I can make short and simple project.
Sergey Alexandrovich Kryukov at 28-Feb-13 11:22am
   
Dictation or some other recognition?
If dictation, then, to best my knowledge, and according to all of the above, you cannot. Especially short and simple. I cannot, too.
As to the recognition of some commands, I already answered. Of course you can. See above.
—SA
depak gupta at 1-Mar-13 1:56am
   
Ok Sir, can I use in built calculator with my voice or can I write on notepad or wordpad by using my speech command. if you can help me little bit coding on this it will be very thankful to me .
Thanks in advance.
Sergey Alexandrovich Kryukov at 1-Mar-13 10:45am
   
Yes, I can help with the advice, but you need to do the work, and you need to start. First critical item is: do you want System.Windows.Forms or WPF application? English or other language? The language if speech recognition installed by default or by user's selection?
—SA
depak gupta at 1-Mar-13 11:17am
   
yes, I have to do on System.Windows.Forms in English language and what ever may be easy whether Speech recognition or user's selection. please suggest as early as possible.
Thank's in advance.
Sergey Alexandrovich Kryukov at 1-Mar-13 11:35am
   
OK, than it won't be a problem. You can use one of the two classes:
SpeechRecognizer or SpeechRecognitionEngine:
 
http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognizer.aspx
http://msdn.microsoft.com/en-us/library/system.speech.recognition.speechrecognitionengine.aspx
 
You will see the code samples, something to start with.
 
Forms is the simplest option, because such application can work in any apartment model. Here is the problem: one of those engines can only work with MTA, another one only in STA (probably SpeechRecognitionEngine, but may be I already forgot). And it is not documented! You can just check it up by testing (on the sample example, changing [STAThread] to [MTAThread] attribute of the entry-point method).
 
As with Forms you can use either of them, you won't need to create a separate recognition thread. Use the sample code as a base, but make it a Forms UI.
 
Make the first simplest prototype and see if you can run it. Ask more questions if you have a problem.
 
That should be enough for now...
 
—SA
 
depak gupta at 1-Mar-13 15:30pm
   
sir, I want to use in-built calculator,notepad or wordpad of windows 8 so how can I get idea with this code it's just a testing recognition by adding words into grammar and in both case I found error ( EmulateRecognizeCompletedHandle and complete ).I have attached code below it please provide little bit detail.also tell how to use STA an MTA is there any reference we have to provide.
Thank's in advamce.
Sergey Alexandrovich Kryukov at 1-Mar-13 16:17pm
   
Could you put your code in the question, using "Improve question", with all the words?
And make sure the code at least compiles...
—SA
depak gupta at 2-Mar-13 2:17am
   
Improve question
 
case 1
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Speech.Recognition;

namespace ConsoleApplication8
{
class Program
{
static void Main(string[] args)
{
// Initialize an instance of the shared recognizer.
using (SpeechRecognizer recognizer = new SpeechRecognizer())
{

// Create and load a sample grammar.
Grammar testGrammar =
new Grammar(new GrammarBuilder("testing testing"));
testGrammar.Name = "Test Grammar";
recognizer.LoadGrammar(testGrammar);

// Attach event handlers for recognition events.
recognizer.SpeechRecognized +=
new EventHandler(
SpeechRecognizedHandler);
recognizer.EmulateRecognizeCompleted +=
new EventHandler(
EmulateRecognizeCompletedHandler);

completed = false;

// Start asynchronous emulated recognition.
// This matches the grammar and generates a SpeechRecognized event.
recognizer.EmulateRecognizeAsync("testing testing");

// Wait for the asynchronous operation to complete.
while (!completed)
{
Thread.Sleep(333);
}

completed = false;

// Start asynchronous emulated recognition.
// This does not match the grammar or generate a SpeechRecognized event.
recognizer.EmulateRecognizeAsync("testing one two three");

// Wait for the asynchronous operation to complete.
while (!completed)
{
Thread.Sleep(333);
}
}

Console.WriteLine();
Console.WriteLine("Press any key to exit...");
Console.ReadKey();
}

// Handle the SpeechRecognized event.
static void SpeechRecognizedHandler(
object sender, SpeechRecognizedEventArgs e)
{
if (e.Result != null)
{
Console.WriteLine("Recognition result = {0}",
e.Result.Text ?? "");
}
else
{
Console.WriteLine("No recognition result");
}
}

 
}
}
 
case 2
using System;
using System.Speech.Recognition;
 
namespace SpeechRecognitionApp
{
class Program
{
static void Main(string[] args)
{
 
// Create an in-process speech recognizer for the en-US locale.
using (
SpeechRecognitionEngine recognizer =
new SpeechRecognitionEngine(
new System.Globalization.CultureInfo("en-US")))
{
 
// Create and load a dictation grammar.
recognizer.LoadGrammar(new DictationGrammar());
 
// Add a handler for the speech recognized event.
recognizer.SpeechRecognized +=
new EventHandler(recognizer_SpeechRecognized);
 
// Configure input to the speech recognizer.
recognizer.SetInputToDefaultAudioDevice();
 
// Start asynchronous, continuous speech recognition.
recognizer.RecognizeAsync(RecognizeMode.Multiple);
 
// Keep the console window open.
while (true)
{
Console.ReadLine();
}
}
}
 
// Handle the SpeechRecognized event.
static void recognizer_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
{
Console.WriteLine("Recognized text: " + e.Result.Text);
}
}
}
Sergey Alexandrovich Kryukov at 2-Mar-13 20:05pm
   
Make sure it at least compiles. It does not because of casing.
I asked to move it to question, "Improve question"; why would you put it in comment?
—SA
depak gupta at 2-Mar-13 4:37am
   
sir. I have posted my code above please provide me solution as early as possible.
depak gupta at 2-Mar-13 11:50am
   
sir, i'm waiting for your reply as I have posted the code above for controlling in-built calculator and one more thing I want to ask you that is how to make recorder with the use of c#.
Waiting for your reply,
Thank's in Advance.
depak gupta at 3-Mar-13 7:55am
   
sir, I have not made any code about controlling calculator with my voice I have just use reference link provided by you yesterday, I had run that code but it was in console where I not found any answer related to my queries, so once again provide me some necessary detail related using calculator as early as possible.
 
Thanks and eagerly waiting for your answer.
Sergey Alexandrovich Kryukov at 3-Mar-13 12:45pm
   
Please read what I told you before and show you code in a readable way... You do have all possible detail.
—SA
depak gupta at 10-Mar-13 5:48am
   
hi sir, after a long I want your help again as I'm not getting tool in c# i.e Custom WaveVeiwer can you help me to get this tool.
Sergey Alexandrovich Kryukov at 10-Mar-13 11:51am
   
This is a very different problem. You would need to ask a separate question.
How about the project using just recognition?
—SA
depak gupta at 11-Mar-13 10:29am
   
OK sir, below I have gave my code with improve code written on it. please check it why I'm not able to write it on richTextBox or improve as you like.
waiting for reply.
Sergey Alexandrovich Kryukov at 11-Mar-13 10:42am
   
Please put the code in question, not the answer. Using "Improve question". You already got down-votes and abuse reports for your "answer", so I removed it, otherwise you would get even more...
—SA
Marcus Kramer at 11-Mar-13 10:53am
   
My 5. Firstly for a great answer, second for the conversation. Wish I had 2 5's to give here. Cheers, Sergey.
Sergey Alexandrovich Kryukov at 11-Mar-13 11:30am
   
Thank you, Marcus. You know, your words are way more important than many 5s. :-)
—SA

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

  Print Answers RSS
0 OriginalGriff 410
1 Jochen Arndt 200
2 Richard MacCutchan 135
3 DamithSL 105
4 PIEBALDconsult 90
0 OriginalGriff 6,045
1 DamithSL 4,601
2 Maciej Los 4,032
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,220


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 11 Mar 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100