-
Jul 18th, 2010, 01:14 AM
#1
Thread Starter
Lively Member
[RESOLVED] Speech
I have SAPI 5.1 installed. I'm using VB 2005.
I can't get this to work.
Code:
Dim spkr As New SpeechLib.SpVoice
The error is "type speechlib.spvoice is not defined."
How do I need to do to get speech to work?
Anyone who does not wonder, is either omnipotent or a fool.
Amerigoware <<<My Projects
-
Jul 18th, 2010, 02:08 AM
#2
Re: Speech
Just like any type, you must first reference the library that it's declared in. You must then either import the namespace it's a member of or else qualify it fully in code.
That said, there is a managed, i.e. .NET, speech API for Vista and later. It would be preferable to use that if you can.
-
Jul 18th, 2010, 05:48 AM
#3
Re: Speech
you need to add a reference to System.Speech, then you can use this:
vb Code:
Dim voice As New System.Speech.Synthesis.SpeechSynthesizer
voice.Speak("words to speak")
- Coding Examples:
- Features:
- Online Games:
- Compiled Games:
-
Jul 18th, 2010, 06:34 AM
#4
Re: Speech
Originally Posted by .paul.
you need to add a reference to System.Speech, then you can use this:
vb Code:
Dim voice As New System.Speech.Synthesis.SpeechSynthesizer
voice.Speak("words to speak")
System.Speech is part of .NET 3.0 and the OP is using VS 2005, so that may not be an option. You don't "need" to reference System.Speech to use SAPI 5.1.
-
Jul 18th, 2010, 12:08 PM
#5
Thread Starter
Lively Member
Re: Speech
I am using Windows XP. What I'm trying to find out it how to "reference the library".
Anyone who does not wonder, is either omnipotent or a fool.
Amerigoware <<<My Projects
-
Jul 18th, 2010, 12:14 PM
#6
Lively Member
Re: Speech
not sure if its the same in 2005 as it is in 2010, but just incase:
Project --> Add Reference
-
Jul 18th, 2010, 12:34 PM
#7
Thread Starter
Lively Member
Resolved... Re: Speech
Thanks. I found it finally. I just added everything that had 'speech' in it and now have no errors.
Anyone who does not wonder, is either omnipotent or a fool.
Amerigoware <<<My Projects
-
Jul 18th, 2010, 06:13 PM
#8
Frenzied Member
Re: Speech
Mark the thread resolved if you don't require further assistance.
Please rate helpful ppl's posts. It's the best 'thank you' you can give
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|