mirror of
https://github.com/TheUltimateHacker/ShiftOS.git
synced 2025-01-22 09:01:58 -05:00
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.
This commit is contained in:
parent
ad47328090
commit
93fa6c7f3a
6 changed files with 49 additions and 10 deletions
|
@ -1,4 +1,6 @@
|
||||||
Module Helper
|
Imports System.Speech.Synthesis
|
||||||
|
|
||||||
|
Module Helper
|
||||||
Dim path As String = ShiftOSDesktop.ShiftOSPath
|
Dim path As String = ShiftOSDesktop.ShiftOSPath
|
||||||
Public Sub addCP(points As Integer) 'Add some CP
|
Public Sub addCP(points As Integer) 'Add some CP
|
||||||
ShiftOSDesktop.codepoints = ShiftOSDesktop.codepoints + points
|
ShiftOSDesktop.codepoints = ShiftOSDesktop.codepoints + points
|
||||||
|
@ -13,4 +15,27 @@
|
||||||
Public Sub playSound(path As String, playMode As AudioPlayMode)
|
Public Sub playSound(path As String, playMode As AudioPlayMode)
|
||||||
My.Computer.Audio.Play(path, playMode)
|
My.Computer.Audio.Play(path, playMode)
|
||||||
End Sub
|
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
|
End Module
|
||||||
|
|
|
@ -92,6 +92,7 @@
|
||||||
<Reference Include="System.IO.Compression" />
|
<Reference Include="System.IO.Compression" />
|
||||||
<Reference Include="System.IO.Compression.FileSystem" />
|
<Reference Include="System.IO.Compression.FileSystem" />
|
||||||
<Reference Include="System.Management" />
|
<Reference Include="System.Management" />
|
||||||
|
<Reference Include="System.Speech" />
|
||||||
<Reference Include="System.Windows.Forms" />
|
<Reference Include="System.Windows.Forms" />
|
||||||
<Reference Include="System.Xml" />
|
<Reference Include="System.Xml" />
|
||||||
<Reference Include="System.Core" />
|
<Reference Include="System.Core" />
|
||||||
|
|
10
ShiftOS/ShiftOSDesktop.Designer.vb
generated
10
ShiftOS/ShiftOSDesktop.Designer.vb
generated
|
@ -2122,7 +2122,7 @@ Partial Class ShiftOSDesktop
|
||||||
'
|
'
|
||||||
Me.UtilitiesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TerminalToolStripMenuItem1, Me.FileSkimmerToolStripMenuItem1, Me.SystemInformationToolStripMenuItem})
|
Me.UtilitiesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.TerminalToolStripMenuItem1, Me.FileSkimmerToolStripMenuItem1, Me.SystemInformationToolStripMenuItem})
|
||||||
Me.UtilitiesToolStripMenuItem.Name = "UtilitiesToolStripMenuItem"
|
Me.UtilitiesToolStripMenuItem.Name = "UtilitiesToolStripMenuItem"
|
||||||
Me.UtilitiesToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
Me.UtilitiesToolStripMenuItem.Size = New System.Drawing.Size(135, 22)
|
||||||
Me.UtilitiesToolStripMenuItem.Text = "Utilities"
|
Me.UtilitiesToolStripMenuItem.Text = "Utilities"
|
||||||
'
|
'
|
||||||
'TerminalToolStripMenuItem1
|
'TerminalToolStripMenuItem1
|
||||||
|
@ -2147,7 +2147,7 @@ Partial Class ShiftOSDesktop
|
||||||
'
|
'
|
||||||
Me.SettingsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ShifterToolStripMenuItem1, Me.SkinLoaderToolStripMenuItem1, Me.SkinShifterToolStripMenuItem1, Me.IconManagerToolStripMenuItem1, Me.NameChangerToolStripMenuItem1})
|
Me.SettingsToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ShifterToolStripMenuItem1, Me.SkinLoaderToolStripMenuItem1, Me.SkinShifterToolStripMenuItem1, Me.IconManagerToolStripMenuItem1, Me.NameChangerToolStripMenuItem1})
|
||||||
Me.SettingsToolStripMenuItem.Name = "SettingsToolStripMenuItem"
|
Me.SettingsToolStripMenuItem.Name = "SettingsToolStripMenuItem"
|
||||||
Me.SettingsToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
Me.SettingsToolStripMenuItem.Size = New System.Drawing.Size(135, 22)
|
||||||
Me.SettingsToolStripMenuItem.Text = "Settings"
|
Me.SettingsToolStripMenuItem.Text = "Settings"
|
||||||
'
|
'
|
||||||
'ShifterToolStripMenuItem1
|
'ShifterToolStripMenuItem1
|
||||||
|
@ -2184,7 +2184,7 @@ Partial Class ShiftOSDesktop
|
||||||
'
|
'
|
||||||
Me.InternetToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ShiftnetToolStripMenuItem1, Me.ShiftoriumToolStripMenuItem1, Me.WebBrowserToolStripMenuItem1, Me.DownloadManagerToolStripMenuItem1, Me.InstallerToolStripMenuItem1, Me.BitnoteDiggerToolStripMenuItem1, Me.BitnoteWalletToolStripMenuItem1, Me.FloodGateManagerToolStripMenuItem, Me.VirusScannerToolStripMenuItem1})
|
Me.InternetToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ShiftnetToolStripMenuItem1, Me.ShiftoriumToolStripMenuItem1, Me.WebBrowserToolStripMenuItem1, Me.DownloadManagerToolStripMenuItem1, Me.InstallerToolStripMenuItem1, Me.BitnoteDiggerToolStripMenuItem1, Me.BitnoteWalletToolStripMenuItem1, Me.FloodGateManagerToolStripMenuItem, Me.VirusScannerToolStripMenuItem1})
|
||||||
Me.InternetToolStripMenuItem.Name = "InternetToolStripMenuItem"
|
Me.InternetToolStripMenuItem.Name = "InternetToolStripMenuItem"
|
||||||
Me.InternetToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
Me.InternetToolStripMenuItem.Size = New System.Drawing.Size(135, 22)
|
||||||
Me.InternetToolStripMenuItem.Text = "Internet"
|
Me.InternetToolStripMenuItem.Text = "Internet"
|
||||||
'
|
'
|
||||||
'ShiftnetToolStripMenuItem1
|
'ShiftnetToolStripMenuItem1
|
||||||
|
@ -2245,7 +2245,7 @@ Partial Class ShiftOSDesktop
|
||||||
'
|
'
|
||||||
Me.GamesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DodgeToolStripMenuItem1, Me.SnakeyToolStripMenuItem1, Me.PongToolStripMenuItem1, Me.KnowledgeInputToolStripMenuItem1, Me.LabyrinthToolStripMenuItem})
|
Me.GamesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.DodgeToolStripMenuItem1, Me.SnakeyToolStripMenuItem1, Me.PongToolStripMenuItem1, Me.KnowledgeInputToolStripMenuItem1, Me.LabyrinthToolStripMenuItem})
|
||||||
Me.GamesToolStripMenuItem.Name = "GamesToolStripMenuItem"
|
Me.GamesToolStripMenuItem.Name = "GamesToolStripMenuItem"
|
||||||
Me.GamesToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
Me.GamesToolStripMenuItem.Size = New System.Drawing.Size(135, 22)
|
||||||
Me.GamesToolStripMenuItem.Text = "Games"
|
Me.GamesToolStripMenuItem.Text = "Games"
|
||||||
'
|
'
|
||||||
'DodgeToolStripMenuItem1
|
'DodgeToolStripMenuItem1
|
||||||
|
@ -2282,7 +2282,7 @@ Partial Class ShiftOSDesktop
|
||||||
'
|
'
|
||||||
Me.AccessoriesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ArtpadToolStripMenuItem1, Me.TextpadToolStripMenuItem1, Me.OrcWriteToolStripMenuItem1, Me.AudioPlayerToolStripMenuItem1, Me.VideoPlayerToolStripMenuItem1, Me.ClockToolStripMenuItem1, Me.CalculatorToolStripMenuItem1})
|
Me.AccessoriesToolStripMenuItem.DropDownItems.AddRange(New System.Windows.Forms.ToolStripItem() {Me.ArtpadToolStripMenuItem1, Me.TextpadToolStripMenuItem1, Me.OrcWriteToolStripMenuItem1, Me.AudioPlayerToolStripMenuItem1, Me.VideoPlayerToolStripMenuItem1, Me.ClockToolStripMenuItem1, Me.CalculatorToolStripMenuItem1})
|
||||||
Me.AccessoriesToolStripMenuItem.Name = "AccessoriesToolStripMenuItem"
|
Me.AccessoriesToolStripMenuItem.Name = "AccessoriesToolStripMenuItem"
|
||||||
Me.AccessoriesToolStripMenuItem.Size = New System.Drawing.Size(152, 22)
|
Me.AccessoriesToolStripMenuItem.Size = New System.Drawing.Size(135, 22)
|
||||||
Me.AccessoriesToolStripMenuItem.Text = "Accessories"
|
Me.AccessoriesToolStripMenuItem.Text = "Accessories"
|
||||||
'
|
'
|
||||||
'ArtpadToolStripMenuItem1
|
'ArtpadToolStripMenuItem1
|
||||||
|
|
|
@ -120,9 +120,6 @@
|
||||||
<metadata name="desktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="desktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>190, 17</value>
|
<value>190, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
<metadata name="desktopappmenu.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
|
||||||
<value>190, 17</value>
|
|
||||||
</metadata>
|
|
||||||
<metadata name="clocktick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
<metadata name="clocktick.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
|
||||||
<value>337, 17</value>
|
<value>337, 17</value>
|
||||||
</metadata>
|
</metadata>
|
||||||
|
|
|
@ -5233,4 +5233,8 @@
|
||||||
refreshIcons()
|
refreshIcons()
|
||||||
'End If
|
'End If
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
|
Private Sub StartFixer(sender As Object, e As MouseEventArgs) Handles desktopicons.MouseDown, pnlpanelbuttonholder.MouseDown
|
||||||
|
If pnladvapplauncher.Visible = True Then pnladvapplauncher.Visible = False
|
||||||
|
End Sub
|
||||||
End Class
|
End Class
|
|
@ -581,7 +581,19 @@ Public Class Terminal
|
||||||
End Sub
|
End Sub
|
||||||
|
|
||||||
Private Sub DoCommand()
|
Private Sub DoCommand()
|
||||||
|
If command Like "speak_infobox '*' '*'" Then
|
||||||
|
Dim findwords() As String = command.Split("'")
|
||||||
|
Helper.speakInfoBox(findwords(1), findwords(3))
|
||||||
|
End If
|
||||||
|
If command Like "speak '*'" Then
|
||||||
|
Dim findwords() As String = command.Split("'")
|
||||||
|
If Not findwords(1) = "" Then
|
||||||
|
Helper.speak(findwords(1))
|
||||||
|
Else
|
||||||
|
Helper.speak("I'm sorry, but you didn't enter anything for me to speak.")
|
||||||
|
End If
|
||||||
|
further = False
|
||||||
|
End If
|
||||||
If command Like "alias *" Then
|
If command Like "alias *" Then
|
||||||
CreatingAlias1 = False
|
CreatingAlias1 = False
|
||||||
CreatingAlias2 = False
|
CreatingAlias2 = False
|
||||||
|
|
Loading…
Reference in a new issue