Last active
August 29, 2015 14:02
-
-
Save leso-kn/1ca1c37e44c6dfda9338 to your computer and use it in GitHub Desktop.
A simple script for TextToSpeech. (Internet speechsynthesizer)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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