Added speak-test.ps1

This commit is contained in:
Markus Fleschutz 2020-12-31 10:02:08 +00:00
parent 21a23422e1
commit 8ca2159d87
3 changed files with 26 additions and 0 deletions

View File

@ -56,6 +56,7 @@ SHA256.ps1, prints the SHA256 checksum of the given file
simulate-matrix.ps1, simulates the Matrix (fun) simulate-matrix.ps1, simulates the Matrix (fun)
simulate-presence.ps1, simulates the human presence against burglars 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-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) speak-text.ps1, speaks the given text by text-to-speech (TTS)
switch-shelly1.ps1, switches a Shelly1 device in the local network switch-shelly1.ps1, switches a Shelly1 device in the local network
take-screenshot.ps1, takes a single screenshot take-screenshot.ps1, takes a single screenshot

1 Filename Description
56 simulate-matrix.ps1 simulates the Matrix (fun)
57 simulate-presence.ps1 simulates the human presence against burglars
58 speak-file.ps1 speaks the content of the given text file by text-to-speech (TTS)
59 speak-test.ps1 performs a speak test by text-to-speech (TTS)
60 speak-text.ps1 speaks the given text by text-to-speech (TTS)
61 switch-shelly1.ps1 switches a Shelly1 device in the local network
62 take-screenshot.ps1 takes a single screenshot

View File

@ -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-matrix.ps1](Scripts/simulate-matrix.ps1) - simulates the Matrix (fun)
* [simulate-presence.ps1](Scripts/simulate-presence.ps1) - simulates the human presence against burglars * [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-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) * [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 * [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 * [take-screenshot.ps1](Scripts/take-screenshot.ps1) - takes a single screenshot

24
Scripts/speak-test.ps1 Executable file
View File

@ -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
}