Welcome to Just answer. My Name isXXXXX and i will be assisting you today.
let me know when you are ready
I am ready.
the problem actually is not related to vb.net rather to the library of speech recognition you are using, I assume its speechlib right?
Please try to do the following: the speechlib will be put into the bin directory once it was added as resources. If you change the operating system, I think you must remove the speechlib.dll then re add it to the project again.
Yes it is SpeechLib. Perhaps I can provide you with the code. As I indicated, it works on XP, Vista, Windows 7 and 8 on all customer machines... EXCEPT THIS PARTICULAR CUSTOMER!!!
ok did you read my last line?
I did indeed. Are you suggesting that I have the customer reload a file?
did you develop this application yourself?
ok when you added the speechlib library
you did add it to the resources of the project right?
Excuse me.... NO.
this results in the speeclib.dll file to be added to the bin directory
ok then how did you include the speechlib library?
Correction... simply REFERENCED
can you further explain what do you mean by simply referenced?
I have simply included an Import: Imports SpeechLib
ok the thing is it needs to be compiled under windows 7
i think it was already compiled on a different OS right?
The customer has Win7, it was developed on Win7. In fact, I have put the development code on his PC via Teamviewer, and even in the development mode (VB.Net 2010), it fails.
ok what i am suggesting is on his pc, do the following remove the speechlib.dll from the bin folder
then readd the reference to the speech library
and re-compile the project
Okay. What will happen if a person with x86 runs my app?
There is both a x86 and x64 versions of speechlib in the package that is referenced
so it should work normally
that's why i am suggested to recompile for this specific machine as it is probably different than the one you previously compiled on.
cpu difference i mean
You're going to love this. I cannot find Speechlib.dll on his pc.
Now that I think about this, there is a:
in the project release on all PCs - EXCEPT HIS!
I think it should be located somewhere
this is the one we are looking for
ok now add the reference again and compile on this specific machine
Perhaps his anti-virus or firewall is BLOCKING the installation of that DLL.
very uncommon but maybe
Please give me a moment... BRB
Let me presume (if I may) that I am able to fix this issue on his PC, how would (can) I repair this "programatically"? I certainly do not want to be telling customers to delete files - half of them cannot even find the Start button!
e.g. Is there a version or file size check?
I think the issue with this library is to have one compiled for x86 and another one for x64
and you can give them the appropriate version according to their cpu
I'm sorry... that's about a clear as mud. Are you saying I need 2 different versions of the code, even though is setup to compile under AnyCPU?
yeah i presume that since the speechlib is compiled according to the cpu version where the project is compiled
does this specific machine is the only x86 machine?
His is a Win7 and it was deployed (via ClickOnce) from Win7
I can only assume that he has a different version of Speechlib already on his pc.
or its the missing dll issue
you said the dll is on all other installation except this one
Doesn't ClickOnce have enough brains to deploy the correct library files?
Sorry.... I was typing
What I said was that it runs fine on hundreds of x86 and Win7/8 pcs - EXCEPT HIS!
but the question is , is this one a 64 bit processor?
Sorry - yes. Both the development PC and his PC are 64 bit machines
ok then the inspection you said regarding the anti virus maybe correct
something prevented the dll to be written to the bin folder
can you copy it form another version and paste it to this specific client machine and try to re-run
Yes. I will do just that. I will copy the DLL from my development environment into his PC.
Okay----let me do some further testing. IS there a way to keep this topic open?
you can bookmark this page
and come back anytime. once you post here i will be notified by email.
Fine. I'll be as quick as possible. Thanks a lot. Later.............
please take a minute to leave me a positive feedback when you can as this is the only way i get compensated for my time and effort
Without question. Regards, Robert
Thanks in advance
Please make sure you have the following set: "platform target" dropdown in project-->properties-->build - setting it to "Any CPU"
Hello. I'm back. I've tried deleting the Speechlib.DLL and re-deployed from the 64-bit PC in the lab... sme problem.
Then, I removed and then added the DLL in the development environment on the user's PC.... same problem.
BTW.... it works fine in the SHARED MODE... it only fails in the INPROC MODE.
did you get my last message?
Here's the code:
Imports SpeechLibImports SpeechLib.SpeechStringConstants
' ====================================================================== ' COMMENT IN FOR SHARED MODE - COMMENT OUT FOR INPROC MODE 'Public RecoInProc As Boolean = False 'Public Recognizer As New SpSharedRecognizer 'Public WithEvents RecoContext As New SpSharedRecoContext 'Public Grammar As ISpeechRecoGrammar ' ====================================================================== ' COMMENT IN FOR INPROC MODE - COMMENT OUT FOR SHARED MODE Public RecoInProc As Boolean = True Public Recognizer As SpInprocRecognizer Public WithEvents RecoContext As SpInProcRecoContext Public Grammar As ISpeechRecoGrammar ' ====================================================================== Public GrammarID = 1 Public WithEvents Voice As New SpeechLib.SpVoice
Public Sub InitializeSpeech() Try If RecoInProc Then Recognizer = New SpInprocRecognizer Debug.Print(Recognizer.GetProfiles.Item(0).GetDescription) Dim ObjectTokenCat As ISpeechObjectTokenCategory ObjectTokenCat = New SpObjectTokenCategory ObjectTokenCat.SetId(SpeechCategoryAudioIn) Debug.Print(ObjectTokenCat.Default) Recognizer.AudioInput = ObjectTokenCat.EnumerateTokens.Item(0) Debug.Print(Recognizer.AudioInput.Category.Default) RecoContext = Recognizer.CreateRecoContext() <<<<<<<<<<<< FAILS HERE !!!!!!!!!!!! Debug.Print(RecoContext.Recognizer.AudioInput.GetDescription) Else RecoContext = New SpSharedRecoContext 'SpInProcRecoContext Recognizer = RecoContext.Recognizer <<<<<<<<<<<< WORKS HERE !!!!!!!!!!!! LogEvent(1, "InitializeSpeech:Recognizer.Profile: " & Recognizer.Profile.GetDescription) LogEvent(1, "InitializeSpeech:Recognizer.Profile.Category.Default: " & Recognizer.Profile.Category.Default) End If Catch ex As Exception LogEvent(1, "ERROR: " & Err.Number.ToString & " DESC: " & Err.Description) End Try
Try Grammar = RecoContext.CreateGrammar(GrammarID) LogEvent(1, "InitializeSpeech:BeforeLoadingSTTFile: " & STTRoot) Grammar.CmdLoadFromFile(STTRoot, SpeechLoadOption.SLODynamic) LogEvent(1, "InitializeSpeech:AfterLoadingSTTFile: " & STTRoot) LogEvent(1, "InitializeSpeech:BeforeSpeechRuleState.SGDSInactive") Grammar.DictationSetState(SpeechRuleState.SGDSInactive) LogEvent(1, "InitializeSpeech:AfterSpeechRuleState.SGDSInactive") Grammar.CmdSetRuleState("", SpeechRuleState.SGDSInactive) LogEvent(1, "InitializeSpeech:BeforeSpeechRuleState.Commit") Grammar.Rules.Commit() LogEvent(1, "InitializeSpeech:AfterSpeechRuleState.Commit") LogEvent(1, "InitializeSpeech:BeforeSpeechRuleState.SGDSActive") Grammar.CmdSetRuleState("", SpeechRuleState.SGDSActive) LogEvent(1, "InitializeSpeech:AfterSpeechRuleState.SGDSActive") Catch ex As Exception LogEvent(1, "ERROR: " & Err.Number.ToString & " DESC: " & Err.Description) End Try HasInitializedSpeech = True End Sub
REGARDING: Please make sure you have the following set: "platform target" dropdown in project-->properties-->build - setting it to "Any CPU"
it works fine in the SHARED MODE... it only fails in the INPROC MODE.? what difference does it make for your project
In the shared mode, voice commands will drive desktop functions. e.g., "Open Notepad". In the InProc mode, the desktop speech box is not present and voice commands only go to our app.
Please keep in mind that it works on hundreds of other PCs just fine!
oh i see so it must be in proc in order for the speech to function correctly
yeah there must be something different about this pc
Correct. Otherwise, a customer will say, "Start engine", and the "Start" button on the desktop open! NOT GOOD )-:
so there must be something about this specific client machine
can you double check the bin folder
see if it is an exact copy of other installations
I agree. But, for the life of me, I cannot figure it out. If you look at the code, (<<<< WORKS HERE) you'll see that the SHARED MODE works. Yet, the inproc (<<<<<<< FAILS HERE) creates the error. And the error message is also strange. It says that the FORMAT IS WRONG. That only applies to inputs from WAV files... not microphones.
BTW... do you want to see the error message? Would that help?
I think there is another dll that should be associated with the speechlib but can't remember its name
Isn't that the one you already added to the main question?
Basically yes. But I have an image of it in mode detail.
ok sure you can use the paper clip icon here to send it to me
I don't know if this will make the mud any clearer!
I checked it
I am sorry i am out of ideas here. I think i will be opting out for other experts to share their thoughts
I'm sorry to hear this. Shall I pay you for your time in any case?
This is up to you. If you wish to do so, just leave me a positive rating.
Thank you in all cases. I tried to help as much as i could
Thank you robert