Skip to content

Instantly share code, notes, and snippets.

@leso-kn
Last active August 29, 2015 14:02
Show Gist options
  • Save leso-kn/1ca1c37e44c6dfda9338 to your computer and use it in GitHub Desktop.
Save leso-kn/1ca1c37e44c6dfda9338 to your computer and use it in GitHub Desktop.
A simple script for TextToSpeech. (Internet speechsynthesizer)
Public Module SpeechSynth
Enum Language As Integer
English = 0
German = 1
French = 2
Spanish = 3
Japanese = 4
Chinese = 5
End Enum
Public Sub Say(ByVal Text As String, Optional ByVal Language As Integer = 0)
Dim Langtext As String = "en"
If Language = 1 Then
Langtext = "de"
End If
If Language = 2 Then
Langtext = "fr"
End If
If Language = 3 Then
Langtext = "sp"
End If
If Chinese = 5 Then
Langtext = "ch"
End If
My.Computer.Audio.Play("http://dict.cc/speak.audio.php?type=wav&lang=" & Langtext & "&text=" & Text, AudioPlayMode.WaitForComplete)
End Sub
End Module
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment