Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Add-Type -AssemblyName System.Speech
- $text = "Hi this is text to wav"
- $speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
- $streamFormat = [System.Speech.AudioFormat.SpeechAudioFormatInfo]::new(8000,[System.Speech.AudioFormat.AudioBitsPerSample]::Sixteen,[System.Speech.AudioFormat.AudioChannel]::Mono)
- $speak.SetOutputToWaveFile("C:\Temp\sound.wav",$streamFormat)
- $speak.Speak($text)
- $speak.Dispose()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement