From 8ca2159d87e97a7f30f57f570ada73a6ce5e29a6 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 31 Dec 2020 10:02:08 +0000 Subject: [PATCH] Added speak-test.ps1 --- Data/scripts.csv | 1 + README.md | 1 + Scripts/speak-test.ps1 | 24 ++++++++++++++++++++++++ 3 files changed, 26 insertions(+) create mode 100755 Scripts/speak-test.ps1 diff --git a/Data/scripts.csv b/Data/scripts.csv index 21b94882..ac1f0be0 100644 --- a/Data/scripts.csv +++ b/Data/scripts.csv @@ -56,6 +56,7 @@ SHA256.ps1, prints the SHA256 checksum of the given file simulate-matrix.ps1, simulates the Matrix (fun) simulate-presence.ps1, simulates the human presence against burglars speak-file.ps1, speaks the content of the given text file by text-to-speech (TTS) +speak-test.ps1, performs a speak test by text-to-speech (TTS) speak-text.ps1, speaks the given text by text-to-speech (TTS) switch-shelly1.ps1, switches a Shelly1 device in the local network take-screenshot.ps1, takes a single screenshot diff --git a/README.md b/README.md index 88c511d4..af5acecb 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,7 @@ The following PowerShell scripts can be found in the [Scripts/](Scripts/) subfol * [simulate-matrix.ps1](Scripts/simulate-matrix.ps1) - simulates the Matrix (fun) * [simulate-presence.ps1](Scripts/simulate-presence.ps1) - simulates the human presence against burglars * [speak-file.ps1](Scripts/speak-file.ps1) - speaks the content of the given text file by text-to-speech (TTS) +* [speak-test.ps1](Scripts/speak-test.ps1) - performs a speak test by text-to-speech (TTS) * [speak-text.ps1](Scripts/speak-text.ps1) - speaks the given text by text-to-speech (TTS) * [switch-shelly1.ps1](Scripts/switch-shelly1.ps1) - switches a Shelly1 device in the local network * [take-screenshot.ps1](Scripts/take-screenshot.ps1) - takes a single screenshot diff --git a/Scripts/speak-test.ps1 b/Scripts/speak-test.ps1 new file mode 100755 index 00000000..3dda129e --- /dev/null +++ b/Scripts/speak-test.ps1 @@ -0,0 +1,24 @@ +#!/snap/bin/powershell +<# +.SYNTAX ./speak-test.ps1 +.DESCRIPTION performs a test speak by text-to-speech (TTS) +.LINK https://github.com/fleschutz/PowerShell +.NOTES Author: Markus Fleschutz / License: CC0 +#> + +try { + $Voice = new-object -ComObject SAPI.SPVoice + $Voice.Speak("This is the default voice") + $Voice.Speak("Let's also try the other voices") + + $Voices = $Voice.GetVoices() + foreach ($OtherVoice in $Voices) { + $OtherVoice.GetDescription() + $Voice.Voice = $OtherVoice + $Voice.Speak("1 2 3 - this is a test") + } + exit 0 +} catch { + write-error "ERROR in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])" + exit 1 +}