Skip to content

Commit 538d524

Browse files
committed
aDDED sPEECH oUT
1 parent c590e2a commit 538d524

2 files changed

Lines changed: 10 additions & 2 deletions

File tree

Chatbot_2020_Tutorial.vbproj

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@
5555
<Reference Include="System.Data" />
5656
<Reference Include="System.Deployment" />
5757
<Reference Include="System.Drawing" />
58+
<Reference Include="System.Speech" />
5859
<Reference Include="System.Web.Extensions" />
5960
<Reference Include="System.Windows.Forms" />
6061
<Reference Include="System.Xml" />

Forms/Form_Chat_UI.vb

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
Imports System.IO
2-
2+
Imports System.speech
33

44
''' <summary>
55
''' This is the Main Communications Center
66
''' </summary>
77
Public Class Form_Chat_UI
8-
8+
Private Speechout As Speech.Synthesis.SpeechSynthesizer
99
Public Newpoint As New Point
1010

1111
'Methods for form positioning
@@ -29,8 +29,15 @@ Public Class Form_Chat_UI
2929
End Get
3030

3131
End Property
32+
Public Sub EffectActuators(ByRef Text As String)
33+
If Loaded = True Then
3234

35+
Speechout.Speak(Text)
36+
End If
37+
38+
End Sub
3339
Public Sub DISPLAYOUTPUT(ByRef NewText As String)
40+
EffectActuators(NewText)
3441
TextOut.Text += "User: " & mInputText & vbNewLine & "AI: " & NewText & vbNewLine
3542
End Sub
3643

0 commit comments

Comments
 (0)