PowerShell Speech Synthesizer

PowerShell has a speech synthesizer! Here’s a fun script to grab random phrases from a file and have your computer speak them!

Add-Type -AssemblyName System.speech $speaker = New-Object System.Speech.Synthesis.SpeechSynthesizer;

$Location = PATH of .csv file $Phrase = (Get-content $Location) | Get-Random

$speaker.rate = -2 #scale from -10 to 10 $speaker.Speak($Phrase)

#this also works for a specified phrase #$speaker.Speak("hello, $env:USERNAME ")