From 50cf8e6a16c696bc1acf0c7fb34e55c44f923682 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 31 Dec 2020 10:10:45 +0000 Subject: [PATCH] Improved speak-test.ps1 --- Scripts/speak-test.ps1 | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/Scripts/speak-test.ps1 b/Scripts/speak-test.ps1 index 3dda129e..97d62e7b 100755 --- a/Scripts/speak-test.ps1 +++ b/Scripts/speak-test.ps1 @@ -8,14 +8,26 @@ try { $Voice = new-object -ComObject SAPI.SPVoice - $Voice.Speak("This is the default voice") - $Voice.Speak("Let's also try the other voices") + Result = $Voice.Speak("This is the default voice") + + $Voice.rate = 10 + $Result = $Voice.Speak("Let's speak fast") + $Voice.rate = -10 + $Result = $Voice.Speak("Let's speak slow") + + $PrevVolume = $Voice.Volume + $Voice.volume = 100 + $Result = $Voice.Speak("Let's speak with maximum volume") + $Voice.volume = 50 + $Result = $Voice.Speak("Let's speak with half volume") + $Voice.volume = $PrevVolume $Voices = $Voice.GetVoices() foreach ($OtherVoice in $Voices) { - $OtherVoice.GetDescription() + $Description = $OtherVoice.GetDescription() + write-output "This is: $Description" $Voice.Voice = $OtherVoice - $Voice.Speak("1 2 3 - this is a test") + Result = $Voice.Speak("1 2 3 - this is $Description") } exit 0 } catch {