function Out-Voice { param([Parameter(Mandatory=$true)]$Text, [switch]$Drunk) $object = New-Object -ComObject SAPI.SpVoice if ($drunk) { $object.Rate = -10 } $object.Speak($text) | Out-Null}
Out-Voice -Text "hello, Unipex is great" Out-Voice -Text "hello, Unipex is great" -Drunk
if you are not familiar with functions just do
$object = New-Object -ComObject SAPI.SpVoice $object.Speak("hello, Unipex is superb") | Out-Null
to get all avalable/installed voices
$object = New-Object -ComObject SAPI.SpVoice $object.GetVoices() | foreach {$_.getdescription()}
Blanka602
bob
igor
machac
machac-lpp
Microsoft Anna – English (United States)
violka
violka-lpp
to set a voice
$voicetouse=$object.GetVoices("Name=bob") $object.voice = $voicetouse.item(0) $object.Speak("kolo")
http://www.ehow.com/how_10073764_speak-different-voices-powershell.html
http://community.spiceworks.com/scripts/show/938-making-remote-computers-speak-what-you-type?page=2
Tagged: COM, Powershell, Text to Speech
Leave a Reply