Powershell Text to Speech

My uses for Powershell have always been very utilitarian.  However, recently I became aware that you can actually do text-to-speech, so I thought I’d play around with it a bit.

This is about the simplest example:

Add-Type -AssemblyName System.speech 
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer 
$speak.Speak('Hello, Is it me you're looking for?')

There are some additional options I came across here.

As you heard, the default voice isn’t that great compared to Alexa, etc. Checking out what other voices I have on my system…

$speak.GetInstalledVoices().VoiceInfo

ps_voice.png

Ok, so it seems I also have Zira, the female voice.

$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak('This voice sounds a bit better than David Desktop')

 

 

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s