|
What account is the service running under? I'l willing to bet it's "Local System", in which case, it doesn't have access to the network drives you're mapping. Services have to login to Windows just like you do. Since I doubt your network allows any machines "Local System" account permissions to network shares, the service has to be told to run under an account that has access to those resources. Open the Services manager and get properties on your service. Click on the Logon tab in the dialog that comes up and tell it to use (as a test!) your account. When the service starts, it'll have access to everything you do.
|
|
|
|
|
I get the same exact error under the Windows Service, after resetting the Drive Mapping, setting the Service Log On credentials, and then re-booting.
Reset Drive mapping:
Drive Z:
Folder \\ServerName\Folder
Connect AS
Username : Domain\MyloginName
Password : ********
checked the -> Reconnect at Login (<-- Luc, Assuming this what you meant by 'mapping is marked persistent')
In Services
Service | Properties | Log On (Tab)
Log on as:
The account: Domain\MyloginName
Password : ********
|
|
|
|
|
If you map the drive in your logon session, the mapping does not carry over to the one the service is using.
The mapping would have to be done in a login script or some other persistance method.
BTW, you should not be using mapped drives in your service, rather UNC paths are preferred.
|
|
|
|
|
The UNC method worked without issue; therefore, for now I'm going to change all the components related to this process to use the UNC rather than a mapped network drive. NOTE: I will follow up with a reply post if I ever isolate why the same code works in the Windows Form but not in the Windows Service.
|
|
|
|
|
Tomb421 wrote: if I ever isolate why the same code works in the Windows Form but not in the Windows Service.
As Luc pointed out, the code works in your WinForms app because the mapping only exists in the process running the WinForms app. The mapping hasn't been defined in the process in which the service runs.
/ravi
|
|
|
|
|
In order to properly target this issue and increase and knowledge for all, please note the following.
In neither the Windows Forms application or the Windows Service Application is there every the creation for the Z: network mapping drive. This mapping was created externally during the booting of the pc and was created with the 'Reconnect at Log On' check true long before to the existence of the Windows Service.
The Windows Forms application or the Windows Service Application use the same routine 'DirectoryInfo' to check for the existence of a FileSearch based on the path passed to the routine. You can review this routine and the errror in the original posting.
Ravi, when you say 'The mapping hasn't been defined in the process in which the service runs.', where you thinking that the z: drive mapping was being dynamically created or is there something I am missing. Please clarify.
/Tom
|
|
|
|
|
Tom, see this[^] link. Let us know if it addresses the problem.
/ravi
|
|
|
|
|
I have tried all of the above and the only solution that I can find that works is by using UNC rather than drive mappings. I am good to go. Thank you for the good advice.
|
|
|
|
|
Hi,
I got 2 forms.. Form1 and Form2.
When the program is executed, Form1 is called. There is a button that will open Form2. At this point of time, Form2 will be on top of Form1. After the user closes Form2, i want form1 to show something..
But i cant find the OnFocus event.. any idea?
|
|
|
|
|
Documentation[^] shows a GotFocus event, which is probably what you want.
|
|
|
|
|
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
|
|
|
|