Tag Archives: COM

Text to speech in Powershell using com object

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

smsagent

Tips, tricks and time-savers for the Windows and ConfigMgr administrator

To The Point

Anything about Technology and Business

Brian's Power Windows Blog

Microsoft in the Enterprise. Windows, Hyper-V, Exchange, SQL, and more!

PowerScripting Podcast

Shownotes and links for the PowerScripting Podcast, a podcast to help people learn Windows Powershell

Learn Powershell | Achieve More

What is this Powershell of which you speak?