email

Wednesday, November 4, 2009

PowerShell: Text to Voice conversion


Today, while playing with PowerShell, I came across a interesting COM object "SAPI.SpVoice". Using this object you can convert given text stream to voice.

Sample script:

[PS] C:\>(new-object -com SAPI.SpVoice).speak("Sitaram Pamarthi")

Usage:

Copy this sample script into powershell window and switch ON your speakers/head phones. You can listen to the voice conversion of text you entered. You can explore more options of this by going through it's properties and methods, (new-object -com SAPI.SpVoice) | get-member.

Happy Learning…,
Sitaram Pamarthi

1 comment: