I was working on some powershell scripts and my son came into the room and asked me if I could get the computer to talk to him, so I had to figure out how to do it:
Add-Type -AssemblyName System.speech
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer
ForEach ($Voice in ($speak.GetInstalledVoices() | % {$_.VoiceInfo.Name})) {
$speak.SelectVoice($Voice)
$speak.Speak("I am the voice of $Voice")
}
Then we came up with a couple of scripts, this was mine:
$speak.SelectVoice('Microsoft David Desktop')
$speak.Speak("Hi Zira, it is nice to meet you")
$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak("Oh! Hi, it is good to meet you too, what was your name again?")
$speak.SelectVoice('Microsoft David Desktop')
$speak.Speak("My name is David, why didn't you just read that from the computer")
$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak("I just wanted to make sure that you liked being called David before I started calling you that")
$speak.SelectVoice('Microsoft David Desktop')
$speak.Speak("Oh! well, actually I prefer to be called Dave")
$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak("Well then, hello dave")
$speak.SelectVoice('Microsoft David Desktop')
$speak.Speak("thank you for thinking about my feelings")
$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak("you are quite welcome")
And this is Evan’s:
$speak.SelectVoice('Microsoft David Desktop')
$speak.Speak("Zira, What time is it?")
$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak("The time is "+(get-date -Format "h mm tt"))
$speak.SelectVoice('Microsoft David Desktop')
$speak.Speak("oh, thank you, I just wanted to know")
$speak.SelectVoice('Microsoft Zira Desktop')
$speak.Speak("oh, your welcome")
And I added additional voices by importing these reg entries
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_EVA_11.0]
@="Microsoft Eva Mobile – English (United States)"
"409"="Microsoft Eva Mobile – English (United States)"
"CLSID"="{179F3D56-1B0B-42B2-A962-59B7EF59FE1B}"
"LangDataPath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,\
00,70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,\
65,00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,\
00,5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,53,00,54,00,54,00,53,00,\
4c,00,6f,00,63,00,45,00,6e,00,55,00,53,00,2e,00,64,00,61,00,74,00,00,00
"VoicePath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,\
70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,65,\
00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,00,\
5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,31,00,30,00,33,00,33,00,45,\
00,76,00,61,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_EVA_11.0\Attributes]
"Age"="Adult"
"Gender"="Female"
"Version"="11.0"
"Language"="409"
"Name"="Microsoft Eva Mobile"
"SharedPronunciation"=""
"Vendor"="Microsoft"
"DataVersion"="11.0.2013.1022"
"PersonalAssistant"="1"
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_EN-US_EVA_11.0]
@="Microsoft Eva Mobile – English (United States)"
"409"="Microsoft Eva Mobile – English (United States)"
"CLSID"="{179F3D56-1B0B-42B2-A962-59B7EF59FE1B}"
"LangDataPath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,\
00,70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,\
65,00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,\
00,5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,53,00,54,00,54,00,53,00,\
4c,00,6f,00,63,00,45,00,6e,00,55,00,53,00,2e,00,64,00,61,00,74,00,00,00
"VoicePath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,\
70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,65,\
00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,00,\
5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,31,00,30,00,33,00,33,00,45,\
00,76,00,61,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_EN-US_EVA_11.0\Attributes]
"Age"="Adult"
"Gender"="Female"
"Version"="11.0"
"Language"="409"
"Name"="Microsoft Eva Mobile"
"SharedPronunciation"=""
"Vendor"="Microsoft"
"DataVersion"="11.0.2013.1022"
"PersonalAssistant"="1"
and
Windows Registry Editor Version 5.00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_MARK_11.0]
@="Microsoft Mark Mobile – English (United States)"
"409"="Microsoft Mark Mobile – English (United States)"
"CLSID"="{179F3D56-1B0B-42B2-A962-59B7EF59FE1B}"
"LangDataPath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,\
00,70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,\
65,00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,\
00,5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,53,00,54,00,54,00,53,00,\
4c,00,6f,00,63,00,45,00,6e,00,55,00,53,00,2e,00,64,00,61,00,74,00,00,00
"VoicePath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,\
70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,65,\
00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,00,\
5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,31,00,30,00,33,00,33,00,4d,\
00,61,00,72,00,6b,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Speech\Voices\Tokens\TTS_MS_EN-US_MARK_11.0\Attributes]
"Age"="Adult"
"Gender"="Male"
"Version"="11.0"
"Language"="409"
"Name"="Microsoft Mark Mobile"
"SharedPronunciation"=""
"Vendor"="Microsoft"
"DataVersion"="11.0.2013.1022"
"PersonalAssistant"="1"
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_EN-US_MARK_11.0]
@="Microsoft Eva Mobile – English (United States)"
"409"="Microsoft Eva Mobile – English (United States)"
"CLSID"="{179F3D56-1B0B-42B2-A962-59B7EF59FE1B}"
"LangDataPath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,\
00,70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,\
65,00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,\
00,5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,53,00,54,00,54,00,53,00,\
4c,00,6f,00,63,00,45,00,6e,00,55,00,53,00,2e,00,64,00,61,00,74,00,00,00
"VoicePath"=hex(2):25,00,77,00,69,00,6e,00,64,00,69,00,72,00,25,00,5c,00,53,00,\
70,00,65,00,65,00,63,00,68,00,5f,00,4f,00,6e,00,65,00,43,00,6f,00,72,00,65,\
00,5c,00,45,00,6e,00,67,00,69,00,6e,00,65,00,73,00,5c,00,54,00,54,00,53,00,\
5c,00,65,00,6e,00,2d,00,55,00,53,00,5c,00,4d,00,31,00,30,00,33,00,33,00,4d,\
00,61,00,72,00,6b,00,00,00
[HKEY_LOCAL_MACHINE\SOFTWARE\WOW6432Node\Microsoft\SPEECH\Voices\Tokens\TTS_MS_EN-US_MARK_11.0\Attributes]
"Age"="Adult"
"Gender"="Male"
"Version"="11.0"
"Language"="409"
"Name"="Microsoft Mark Mobile"
"SharedPronunciation"=""
"Vendor"="Microsoft"
"DataVersion"="11.0.2013.1022"
"PersonalAssistant"="1"