473,396 Members | 1,768 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

Why does not vb.net code for text to speech run correctly even with no errors?

[code]

Imports System.Speech.Synthesis
Public Class Form1

Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
ComboBox1.Items.Add("Male")
ComboBox1.Items.Add("Female")
End Sub

Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim SAPI
Dim synth As New SpeechSynthesizer
SAPI = CreateObject("sapi.spvoice")
SAPI.Speak(TextBox1.Text)
SAPI.Volume = VolumeTrackBar.Value
SAPI.Rate = SpeedTrackBar.Value
If ComboBox1.Text = "Male" Then
SAPI.SelectVoice = (VoiceGender.Female)
ElseIf ComboBox1.Text = "Female" Then
SAPI.SelectVoice = (VoiceGender.Male)
End If
End Sub

End Class
Jul 4 '17 #1
0 1375

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: Douglas Buchanan | last post by:
The 'Start Page' in the IDE of VS.Net Professional edition not list recent projects correctly (by date). Sometimes it does not list them at all even though I have recently opened and worked on...
6
by: pit3k | last post by:
My program tries to call the vector::push_back(...) member function in a loop couple dozen milion times, which is what I expect. After about 20 millions successfull push_back() calls the program...
1
by: Niks | last post by:
I have a dialog which contains a tree & list Control. On clicking, of tree item, the list ctrl list changes. The list ctrl has 2 fields(Name & Value) & is of 'Report' Type. The list ctrl data is...
2
by: Kurt Schroeder | last post by:
Still new to code behind so i'm not sure what the problem is (i'm using visualStudio.net for the first time) like my last question i'll bet this has a quick answer. thanks kes here is the error:...
1
by: Steve | last post by:
Public ncorrect As Integer Public ntotal As Integer Sub addcheckt()
2
by: Rico | last post by:
Hello, I have a Win2K3 Server with SS2005 developers edition. I am working on a Windows XP Pro workstation which has SQL Server 2000 installed as well as the SQL Native Client. I'm using an MS...
1
by: VanZandt | last post by:
I have a class(dll) that extends winform datagrid to provide link column in vb.net. I have managed to create a datagrid in c# winforms that shows link in one of the column but when I try to create a...
4
by: Duncan Smith | last post by:
I have a VS2005 C++ MFC project which #imports a type library. The goal is to introduce some managed code eventually, but for starters I just need to set the /clr compiler option and build the...
4
by: rawky1976 | last post by:
Hi, I have a hyperlink which goes to the page below and passes the PK_ID from a query into 'userid'. From this we query the DB and then echo a table with a form; only the textboxes are already...
5
by: Neil | last post by:
Does anyone have any code for setting the VBA option to "Break on Unhandled Errors" (Access 2000). Thanks! Neil
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.