Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #Text2Speech
- Add-Type -AssemblyName System.speech
- $tts = New-Object System.Speech.Synthesis.SpeechSynthesizer
- # Importing from text file
- #$PhraseLocation = "C:\ListOfPhrases.csv"
- #$Phrase = (Get-Content $PhraseLocation) | Get-Random
- # Using an array
- $Phrase2 = @("I am a robot","Help, I'm stuck in the computer!","What are you doing, $env:USERNAME")
- $tts.Rate = 0 # -10 is slowest, 10 is fastest
- $tts.Speak($Phrase2)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement