Created
July 10, 2016 16:38
-
-
Save alshell7/4557588efef763bb81c1295aff1c02a4 to your computer and use it in GitHub Desktop.
Convert text to speech with having the output be saved in specified location in *.wav format file.
This file contains 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
Imports System.Speech.Synthesis | |
Public Class Form1 | |
Dim spsynth As New Speech.Synthesis.SpeechSynthesizer | |
Private Sub SaveTTStoFile(ByVal TextToSpeak As String,ByVal FileLocation As String ) | |
Try | |
With spsynth | |
.Volume = 100 | |
.SetOutputToDefaultAudioDevice() | |
.SelectVoiceByHints(VoiceGender.Female, VoiceAge.Adult) | |
.SetOutputToWaveFile(FileLocation) 'Example "D:\mypara.wav" | |
End With | |
spsynth.SpeakAsync(TextToSpeak) 'blah blah blah | |
'Process.Start(TextToSpeak) | |
Catch ex As Exception | |
MsgBox(ex.Message) | |
End Try | |
End Sub | |
End Class |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment