|
somehow, my form dont have the GotFocus event
|
|
|
|
|
I don't see how that's possible.
|
|
|
|
|
this might do what you are looking for.
Form1.Close();<br />
Form2.Show();
Or
Form2.Close()<br />
Form1.Show();
|
|
|
|
|
in WinForm every Control has a GotFocus event.
so please clarify and justify your observation.
|
|
|
|
|
i have look thru many times.. Do not have the GotFocus event..
Well, i think i create a static method in Form1 and before Form2 closes, it will fire Form1 method instead of using the GotFocus
|
|
|
|
|
benjamin yap wrote: i have look thru many times
through what?
If you can't give clear and detailed information, people won't be able to offer effective help.
|
|
|
|
|
You have one, every form that inherits from system.windows.forms.form has one.
|
|
|
|
|
Hi all,
I am trying to perform acoustic training from a wav file using SAPI 5.3. I am able to load the wav file and have it recognized and transcribed by the Speech Runtime.
Now my problem is that I want to supply a character string to the engine using the ISpTranscript interface described in the SAPI 5.3 documentation. This step is necessary in order to have the speech engine be trained from the wav file. However, when I search for it (in Visual Studio 2008 object browser) it is not there. I find a few examples of it using the interface in C++ but none using C#. According to the documentation you would use QueryInterface to instantiate the ISpTranscript object from the SpStream object. In C#, there is no method provided (Such as GetTranscript()) in the SpStream object or any of its derived classes.
Is this something that should be done in C++ in order to have it instantiate? Or am I way off the mark in trying to solve this problem. Any help or insight into this matter would be welcomed and appreciated.
I will post all the code once completed. If someone is interested in any of the functionality that I do have complete, I would be willing to share it.
|
|
|
|
|
Do you want to recognized specific words ?
Tell me more, because the Speech engine has changed a little bit. So, I will be able to help you, just let me know what do you want to do with your wave file ? Recognize some words and execute commands for instance ?
|
|
|
|
|
Thanks for your reply.
I want a user to be able to improve the speech engine's recognition capability over time. In my application I want a user to be able to start using it immediately. The user will then be able to review what the engine's output was and correct it. The application will then use the corrected text along with the original wav file to teach the speech engine to improve it's transcription ability over time for a specific user.
I hope that makes sense. Please let me know if you need some clarification.
|
|
|
|
|
In fact in C# the speech recognition is not directly based on the SAPI interface, there is an inermediate level.
This code will not help to train... !!! I didn't find the interface based on its guid (ISpTranscript) in the System.Speech
SpeechRecognitionEngine engine = new SpeechRecognitionEngine();
engine.SetInputToWaveFile("MyWaveFile.wav");
engine.LoadGrammar(new DictationGrammar());
engine.RecognizeAsync(RecognizeMode.Multiple);
engine.SpeechRecognized += new EventHandler<SpeechRecognizedEventArgs>(engine_SpeechRecognized);
// In order to know when the wave is finished
engine.AudioStateChanged += new EventHandler<AudioStateChangedEventArgs>(engine_AudioStateChanged);
Hope it helps...
|
|
|
|
|
Hi Thanks for your help.
I also did not find the interface for ISpTranscript in the System.Speech assembly or directly in the SpeechLib.dll.
However, I finally tried it out in C++ and was able to find the interface for it.
It is declared in the sapi.h header file and it could be instatiated using the CoCreateInstance method.
Since I was not able to find any information on it anywhere for over a month, I will go out on a limb and say that ISpTranscript can not be instantiated in C# for training the speech engine with your own custom string. I hope this educated opinion will stop someone else from searching for an answer on the internet for too long. If it can be done, please prove me wrong
When coding in C++ you will also need to update sphelper.h in a few places in order to get it to compile.
See this link for help:
http://social.msdn.microsoft.com/forums/en-US/vcgeneral/thread/38085678-e54c-4923-b817-3790b3634798/[^]
The C++ code for getting the ISpTranscript interface to instantiate could be found here:
http://msdn.microsoft.com/en-us/library/ms717071(VS.85).aspx[^]
|
|
|
|
|
Hi Mudrugger,
Thank you very much for all the info. I have also started working on exactly same kind of application features initially on C# and later moved to C++ after your posting. I have managed to recognize from a wave file and produce the text output. However, the accuracy isn't good and for which I am trying to buildup the training module. I believe I have done most the things required by training module like--> setTrainingstate(1,1), Add CFG grammer for the input text, appendtranscript the text with the wave file, activate the diction and complete the training. I even tried running the loop 100 times. However, no effect is taking place. Were you able to crack this down? If yes, could you kindly provide me some insights, help of any sorts? It would be a great help. Many thankx.
TKM
|
|
|
|
|
|
mudrugger,
Thank you for your input it stopped my endless searching. It would be extremely helpful if you could post your C++ training routine (I am C# developer). How do you know if the training helped? Also does the training specifically help the recognizer understand just the words trained?
Thanks again,
aidesigner
|
|
|
|
|
Anyone know of a custom drop down item that works with the ToolStripContainer and provides a color drop down button? I've looked here on CP and was surprised that there weren't any articles, or I couldn't find any so far.
Never mind, found it:
Office 2003 Color Picker[^]
modified on Friday, December 18, 2009 12:33 PM
|
|
|
|
|
I'd like to convert an integer to a byte. Then going through some process steps (i don't know how to do and need your help), finally when apply (b<<24) i'd like it return to the integer's value before. How I can do that?
int temp;
byte b;
int result=(b<<24);
Thank you so much!
modified on Friday, December 18, 2009 10:55 AM
|
|
|
|
|
I did following but result is 0, not 5.
int temp=5;
byte b=(byte)(temp>>24);
int result=b<<24;
Console.WriteLine(result);
Could you post some code? Thanks your reply!
|
|
|
|
|
That's because your shifting all your bits to the right and off a cliff.
int temp = 5;
int t1 = temp << 24;
int t2 = t1 >> 24;
Console.WriteLine(t2);
Regards,
Rob Philpott.
|
|
|
|
|
I'm sorry. My question is not correct. I modified it. Please read it again and help me!.
Thanks so much!
|
|
|
|
|
What you want is in conflict with what you want. For starters there is no way to convert "any int" to a byte (proof: there are more possible values for an int than for a byte)
What are you trying to do with this calculation? Maybe we can suggest an alternative?
|
|
|
|
|
Hi,
you probably are confusing two things:
1.
assuming b is unsigned or positive, b<<24 is an attempt to generate a larger number, in fact it is equivalent to a multiplication by 2^24 (which might overflow, i.e. loose bits shifted out at the high end, and therefore could result in zero). Anyway, it is a numeric or mathematical operation. So is 5>>24 which will result in zero since all bits get lost at the low end, as others have said already.
2.
multi-byte variables (such as int) are stored in memory in one of two ways:
"big endian" = the most significant byte comes first (i.e. at the lowest address)
"little endian" = the least significant byte comes first.
Intel processors (and some others too) implement the little-endian convention. Other processor families, and some networks and protocols use big-endian (e.g. the administrative information used on Ehternet networks).
Both issues are unrelated. If you want to operate on values/numbers, look at (1). If you want to operate on memory bytes, don't look at (1), use the BitConverter class instead (or a fake "union" construction, with a struct and explicit offsets).
modified on Friday, December 18, 2009 11:44 AM
|
|
|
|
|
byte b0=GetByte();
byte b1=GetByte();
byte b2=GetByte();
byte b3=GetByte();
int vr= + b1;
if ((b0<<8+b1)==0x4F42)
{
int length;
if (littleEndian)
length=(b3<<24) + (b2<<16) + (b1<<8) + b0;
else
length=(b0<<24) + (b1<<16) + (b2<<8) + b3;
}
Now I have a value of length variable and to convert inverse direction. I'd like to gain b0, b1, b2, b3.
And those gained b0, b1 must ensure when apply (b0<<8) + b1 will be equal to 0x4F42 again.
That's what I want to. Before i try to simplify my problem but unfortunately i made it difficult to understand for you.
Please help me! Thank you so much!
|
|
|
|
|
Well if that's all then we gave you the answer countless times, right?
|
|
|
|
|
Hello.
I have got two ListViews in one Form.
When I select one DataSet in the first one, the second one will be filled with the correct data. Now I shall allow to select a dataset in the second one. But, when I do this, the selection in the first one is canceld. How can I awoid this deselection? Both seletions should be shown.
Regards, Taggi
How do you know, that Tagamoga has been assimilated by the borg?
"Recistunce ist fiutille."
Sorry for violating the english language.
|
|
|
|