Advertisement
Combreal

textosound.ps1

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