Skip to content

Instantly share code, notes, and snippets.

@ankappatd
Forked from gfoss/say.ps1
Created April 20, 2020 13:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ankappatd/c69ee487cd1e2d502f657a38877796c8 to your computer and use it in GitHub Desktop.
Save ankappatd/c69ee487cd1e2d502f657a38877796c8 to your computer and use it in GitHub Desktop.
PowerShell Say
function say {
param( [string]$comment = $_ )
[Reflection.Assembly]::LoadWithPartialName('System.Speech') | Out-Null
$object = New-Object System.Speech.Synthesis.SpeechSynthesizer
$object.SelectVoiceByHints('Female')
$object.Speak("$comment")
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment