aboutsummaryrefslogtreecommitdiff
path: root/ShiftOS/Helper.vb
diff options
context:
space:
mode:
authorTheUltimateHacker <[email protected]>2015-03-16 16:20:39 -0400
committerTheUltimateHacker <[email protected]>2015-03-16 16:20:39 -0400
commit93fa6c7f3ad937d31eba7256ca27e1c7e579086b (patch)
tree2c5349ec921e5dd1ecda889aee94763fa9d2b6c9 /ShiftOS/Helper.vb
parentad47328090b8225dfe7c43283bfcb0ddeee506e7 (diff)
downloadshiftos-93fa6c7f3ad937d31eba7256ca27e1c7e579086b.tar.gz
shiftos-93fa6c7f3ad937d31eba7256ca27e1c7e579086b.tar.bz2
shiftos-93fa6c7f3ad937d31eba7256ca27e1c7e579086b.zip
Speech Synth System added for future AI Character
Added a new Speech Synth system using the .NET Framework's Speech Synth API. To utilize this system, I've added 3 new functions in Helper.vb called speak(Text As String), speakInfoBox(Title As String, Text As String) and speakOnTerminal(Text As String) as well as 2 new Terminal cmdlets, one called speak 'Text in Single Quotes' and speak_Infobox 'Title' 'Text'. These two commands should not be bundled with the full release of 0.0.9. I've also fixed a bug with the Advanced App Launcher, where the AAL would not close unless you clicked "Applications" or clicked an option in the AAL. Now, clicking the Desktop Panel and Desktop will close the AAL. I have yet to figure out the Skin Loader AAL loading issue (Can't run Skin Loader from the AAL), but that'll be my next bugfix.
Diffstat (limited to 'ShiftOS/Helper.vb')
-rw-r--r--ShiftOS/Helper.vb27
1 files changed, 26 insertions, 1 deletions
diff --git a/ShiftOS/Helper.vb b/ShiftOS/Helper.vb
index 19a1b2e..f2be24a 100644
--- a/ShiftOS/Helper.vb
+++ b/ShiftOS/Helper.vb
@@ -1,4 +1,6 @@
-Module Helper
+Imports System.Speech.Synthesis
+
+Module Helper
Dim path As String = ShiftOSDesktop.ShiftOSPath
Public Sub addCP(points As Integer) 'Add some CP
ShiftOSDesktop.codepoints = ShiftOSDesktop.codepoints + points
@@ -13,4 +15,27 @@
Public Sub playSound(path As String, playMode As AudioPlayMode)
My.Computer.Audio.Play(path, playMode)
End Sub
+
+ Public Sub speak(text As String)
+ Dim speaker As New Speech.Synthesis.SpeechSynthesizer
+ speaker.Speak(text)
+ End Sub
+ Public Sub SpeakOnTerminal(text As String)
+ Dim txt As TextBox = Terminal.txtterm
+ If Terminal.Visible = False Then
+ Terminal.Show()
+ txt.Text = ""
+ End If
+ txt.Text = txt.Text + vbNewLine + text
+ Dim speaker As New SpeechSynthesizer
+ speaker.Speak(text)
+ End Sub
+
+ 'Misc. Features that aren't practical, but fun to mess around with in the game engine
+ Public Sub speakInfoBox(title As String, text As String)
+ infobox.showinfo(title, text)
+ Dim speaker As New SpeechSynthesizer
+ speaker.Speak(title & "..." & text)
+ infobox.Close()
+ End Sub
End Module