Microsoft Speech SDK 5.1

G

Guest

Hi all, is there any one who have developed an application in c# using a
text-speech engine using the Microsoft Speech SDK 5.1 especially using visual
studio.net IDE 2003 (v7.1) I seem to get an inter-op compiling error and cant
seem to resolve it! help!
 
A

Adam Clauss

I'm currently using the SDK in a C# app (VS 2003). Having no problems at
all with it compiling, what error are you seeing?
 
G

Guest

Hi Adam, below is my original problem which i found when trying to compile
the simple TTS application which another person had an issue with as stated
below by me:


Hi found this article on a discussion group while i was searching on how to
resolve exacly the same issue...so rather than repeating the writing i have
pasted it below :

{{{{{I am having some problem with the SimpleTTS for C# and Speech List Box
for C
# examples in the Microsoft Speech SDK 5.1. When I try to build the samples
I get the following error:

F:\Visual Studio Projects\CSharp\SimpleTTS\MainForm.cs(12): The type or name
space name 'SpeechLib' could not be found (are you missing a using directive
or an assembly reference?)

Then, in an attempt to add the reference - I add a reference to Interop.Spee
chLib.dll, which is in the bin directory. However, after adding the referenc
e I get the following error:

F:\Visual Studio Projects\CSharp\SimpleTTS\MainForm.cs(36): 'SimpleTTS.MainF
orm.Dispose()' : cannot override inherited member 'System.ComponentModel.Com
ponent.Dispose()' because it is not marked virtual, abstract, or override


Any feedback would be appreciated,}}}}}}

below is the full link to the above article in the discussion group i found
it at and solutions from replying users but did not seem to work, the guy who
posted it tried and i also tried!!!

has anyone encountered this and had any luck??
 
A

Adam Clauss

How did you actually go about adding the referecne? Went to Add Reference,
COM tab, and selected the Microsoft Speech Object Library?
 
A

Adam Clauss

Although... it's odd. The sample should come with the reference already
added - mine did...
 
G

Guest

Hi Adam, thatis what i did...i went to the add reference/com tab then browsed
to the Bin directory to added the Interop.SpeechLib and the namespace in the
file, when i build it i get build errors and when it prompts me in the
dialogue box "if i want to continue" i click yes and then i get this error in
a messagebox :

Visual Studio cannot start debugging because the debug target'C:\Program
Files\ Microsoft Speech SDK
5.1\Samples\Csharp\SimpleTTS\bin\Debug\SimpleTTS.exe' is missing.Please build
the broject and retry.

and that is all i get when i try to biuld/compile the project
did you experience this ?
 
A

Adam Clauss

No no - don't go to the bin directory and add the reference there. Scroll
through the COM list for the "Microsoft Speech Object Library".
 
G

Guest

Hi Adam o.k i removed the one from the bin directory and added the one from
the com list and still have the "using SpeechLib" as that is what it appears
as in the reference solution explorer (SpeechLib)...recompiled it still the
same issue
 
A

Adam Clauss

OK... find that line where Dispose is declared...
replace that method with:
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (components != null)
components.Dispose();
}


Now that I think back, I actually think I had the same problem - it isn't
actually a problem with the speechlib at all, just a change that was made in
Dispose. (AKA - you could create your own app, add a reference to SpeechLib
and it would work fine). This change should fix the SimpleTTS app though.
 
G

Guest

just to crosscheck my vs.net is the same version and environment as
yours...mine is:

Microsoft development environment 2003 Version 7.1.3088
Copyright 1987-2002 Microsoft Corporation all rights reserved

Microsoft .Net Framework 1.1 version 1.1.4322
Copyright 1987-2002 Microsoft Corporation all rights reserved

from the Help menu/about dialogue... are they the same or different?
 
G

Guest

o.k so which seervice pack are you using an earlier one? or a later one...

also more specifically i get this error:

C:\Program Files\Microsoft Speech SDK
5.1\Samples\CSharp\SimpleTTS\MainForm.cs(36): 'SimpleTTS.MainForm.Dispose()'
: cannot override inherited member
'System.ComponentModel.Component.Dispose()' because it is not marked virtual,
abstract, or override

but i have checked using the object browser and the Base.Dispose()it is
marked 'virtual' ..
so why is this driving me nuts..and not working any further ideas..?
 
A

Adam Clauss

I have a service pack 1 for .NET 1.1, you do not. You probably should get
it (though I do not think it is related to this error). WindowsUpdate will
have it listed.

Look at my earlier post, see if that fixes it:
<snip>
OK... find that line where Dispose is declared...
replace that method with:
protected override void Dispose(bool disposing)
{
base.Dispose(disposing);
if (components != null)
components.Dispose();
}


Now that I think back, I actually think I had the same problem - it isn't
actually a problem with the speechlib at all, just a change that was made in
Dispose. (AKA - you could create your own app, add a reference to SpeechLib
and it would work fine). This change should fix the SimpleTTS app though.
 
G

Guest

Hi Adam thanks very much it worked!!!!
could you briefly explain to me how you solved it be adding the extra
code...i would really like to know , exactly how you can to that comclussion
please cheers!!!--
The Matrix Insurrection
 
A

Adam Clauss

Well, I had to stop trying to think of the problem in terms of speech SDK
first, cause the error itself has nothing to do with it.

I am assuming at some point the Dispose method underwent a change (possibly
in .NET 1.0 -> .NET 1.1?). This sample was just not updated accordingly,
and thus the error. As to how I actually fixed it, if I recall correctly,
the original code was trying to override Dispose() (no parameters) right? I
think the documentation for that method is actually wrong - it is NOT
virtual.

Now, if you type in "override" in the code, VS will popup a list of all the
methods that you can choose from to override. On that list is only the
dispose that takes a bool parameter. Switched to that one, and *poof* it
works.
Note: If you have the method already overriden, it will not appear in the
list.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top