Speaking English and German (and Spanish, and you name it)

by Feb 3, 2014

Windows 8 is the first operating system that comes with fully localized text-to-speech engines. So you can now have PowerShell speak (and curse) in your mother tongue.

At the same time, there is always an English engine, so your computer is now bilingual.

Here is a sample script for German systems (that is easily adaptable to your locale). Simply change the language IDs (like "de-de" for German), and have Windows speak in another language.

Note: Before Windows 8, only English engines shipped. With Windows 8, you will also get your local language. No other languages.

$speaker = New-Object -ComObject SAPI.SpVoice
$speaker.Voice = $speaker.GetVoices() | Where-Object { $_.ID -like '*de-de*'}
$null = $speaker.Speak('Ich spreche Deutsch')
$speaker.Voice = $speaker.GetVoices() | Where-Object { $_.ID -like '*en-us*'}
$speaker.Speak('But I can of course also speak English.')

Twitter This Tip! ReTweet this Tip!