Last active
January 14, 2019 23:28
-
-
Save M3T4L5T3F/51cd735e6873b5275d67688f1d351607 to your computer and use it in GitHub Desktop.
Windows Command line speech - PowerShell
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Use Windows Speech engine with PowerShell | |
# | |
# Usage example: powershell .\PSSay.ps1 'This is a test' | |
# | |
# Thanks to Greg Foss for the original example! | |
# https://gist.github.com/gfoss | |
param( [string]$comment = $_ ) | |
Add-Type -AssemblyName System.speech | |
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
#Options you can tweak below: Female-Male-Neutral | |
# There are also 'age' settings in the .NET documentation that I haven't dug into yet. | |
$speak.SelectVoiceByHints('Female') | |
$speak.Speak("$comment") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment