Created
June 8, 2019 13:34
-
-
Save Y-Koji/cf1e518996934cfafbba1a09c699bf94 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function Speak-Text { | |
param($text) | |
Add-Type -AssemblyName System.Speech | |
$ss = New-Object System.Speech.Synthesis.SpeechSynthesizer | |
$ss.Volume = 100 | |
$ss.SelectVoiceByHints( | |
[System.Speech.Synthesis.VoiceGender]::Female, | |
[System.Speech.Synthesis.VoiceAge]::Adult) | |
$ss.SetOutputToDefaultAudioDevice() | |
$ss.Speak($text) | |
$ss.Dispose() | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment