Add list-voices.ps1

This commit is contained in:
Markus Fleschutz 2021-07-16 17:34:03 +02:00
parent f40b13b5d3
commit dd1a0ec7a0
3 changed files with 27 additions and 0 deletions

View File

@ -127,6 +127,7 @@ list-timezone.ps1, lists the current time zone details
list-timezones.ps1, lists all time zones available
list-tiobe-index.ps1, lists the TIOBE index of top programming languages
list-user-groups.ps1, lists the user groups on the local computer
list-voices.ps1, lists the installed text-to-speech (TTS) voices
list-weather.ps1, lists the hourly weather
list-workdir.ps1, lists the current working directory
locate-city.ps1, prints the geographic location of the given city

1 Script Description
127 list-timezones.ps1 lists all time zones available
128 list-tiobe-index.ps1 lists the TIOBE index of top programming languages
129 list-user-groups.ps1 lists the user groups on the local computer
130 list-voices.ps1 lists the installed text-to-speech (TTS) voices
131 list-weather.ps1 lists the hourly weather
132 list-workdir.ps1 lists the current working directory
133 locate-city.ps1 prints the geographic location of the given city

View File

@ -9,6 +9,7 @@ Mega Collection of PowerShell Scripts
-----------------------------
* [convert-txt2wav.ps1](Scripts/convert-txt2wav.ps1) - converts text to a .WAV audio file
* [mute-audio.ps1](Scripts/mute-audio.ps1) - mutes audio
* [list-voices.ps1](Scripts/list-voices.ps1) - lists the installed text-to-speech (TTS) voices
* [play-beep.ps1](Scripts/play-beep.ps1) - plays a beep sound
* [play-files.ps1](Scripts/play-files.ps1) - plays the given audio files
* [play-mission-impossible.ps1](Scripts/play-mission-impossible.ps1) - plays the Mission Impossible theme

25
Scripts/list-voices.ps1 Normal file
View File

@ -0,0 +1,25 @@
<#
.SYNOPSIS
list-voices.ps1
.DESCRIPTION
Lists the installed text-to-speech (TTS) voices
.EXAMPLE
PS> .\list-voices.ps1
.LINK
https://github.com/fleschutz/PowerShell
.NOTES
Author: Markus Fleschutz / License: CC0
#>
try {
$Voice = new-object -ComObject SAPI.SPVoice
$Voices = $Voice.GetVoices()
foreach ($OtherVoice in $Voices) {
$Description = $OtherVoice.GetDescription()
"* $Description"
}
exit 0
} catch {
write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
exit 1
}