mirror of
https://github.com/fleschutz/PowerShell.git
synced 2024-12-24 15:49:02 +01:00
Added speak-test.ps1
This commit is contained in:
parent
21a23422e1
commit
8ca2159d87
@ -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
|
||||
|
|
@ -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
|
||||
|
24
Scripts/speak-test.ps1
Executable file
24
Scripts/speak-test.ps1
Executable 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user