mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-02-02 19:09:13 +01:00
Add list-voices.ps1
This commit is contained in:
parent
f40b13b5d3
commit
dd1a0ec7a0
@ -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
|
||||
|
|
@ -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
25
Scripts/list-voices.ps1
Normal 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
|
||||
}
|
Loading…
Reference in New Issue
Block a user