Share this post:

Adam the Automator sent me down the rabbit hole when he posted about adding voice to your Windows PowerShell scripts using text to speech.

After walking through Francisco Navarro’s tutorial, I thought I’d have a little fun. There are two voices available by default in the EN-US version of Windows 10, David and Zira. David is a male voice and Zira is a female voice. This got me thinking, they should do a duet!

Note:
The SpeechSynthesizer class is native to the Windows .NET framework, so this will only work in Windows PowerShell.

The great thing about doing things like this is that it makes learning fun. Even though the outcome might not be all that useful, I learned several things that I can apply in other more “productive” scripts. I learned about loading assemblies to access classes not natively available in Windows PowerShell. I experimented with multiple instances of an object (David and Zira). I also learned about exploring an objects properties and how a property can be an embedded object with it’s own properties. I also got to experiment with executing commands synchronously and asynchronously to get my duet to “sing” together.

P.S. If you really want it, I posted the full version on GitHub. 🤣
Endless Love by Microsoft David and Microsoft Zira

Share this post:

Categories:

Comments are closed