Created
February 12, 2013 02:10
-
-
Save jeffa00/4759556 to your computer and use it in GitHub Desktop.
Speech In PowerShell using Windows Speech API COM object
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
function Out-Speech($text) { | |
$speechy = New-Object –ComObject SAPI.SPVoice; | |
$voices = $speechy.GetVoices(); | |
foreach ($voice in $voices) { | |
$voice.GetDescription(); | |
$speechy.Voice = $voice; | |
$speechy.Speak($text); | |
} | |
} | |
Out-Speech("Testing, One, Two, Three"); | |
#Out-Speech("Eye m gunna ki ick yur ice, you sum bee itch!"); | |
#Out-Speech("Oh no you dih-int.") | |
#Out-Speech("Ahsk naught wot yawr con tree con dew far you, ahsk wot yew con dew far yawr con tree") | |
#Out-SPeech("Eets a ME, Ah Mahd Eo") | |
#Out-Speech("Oh, dear! My bum is itching most terribly! I must scoot around on the rug to scratch it! Oh yes! That is SPLENDID!") | |
#Out-Speech("Turn left, in 100 feet and plow into that bus full of nuns.") | |
#Out-Speech("Accelerate up ramp and leap over all those stupid buses Evil K-neivel!") | |
#Out-Speech("In 100 feet you will die in a fiery explosion of death and molten car parts. So says the Oracle Of The Dashboard!") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment