mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-05-18 14:30:53 +02:00
Update list-voices.ps1
This commit is contained in:
parent
d92d477f9a
commit
00eaa9b4a8
@ -1,8 +1,8 @@
|
|||||||
<#
|
<#
|
||||||
.SYNOPSIS
|
.SYNOPSIS
|
||||||
Lists the installed text-to-speech (TTS) voices
|
Lists the installed text-to-speech voices
|
||||||
.DESCRIPTION
|
.DESCRIPTION
|
||||||
list-voices.ps1
|
This script lists the installed text-to-speech voices. It requires PowerShell 2.0 or higher.
|
||||||
.EXAMPLE
|
.EXAMPLE
|
||||||
PS> ./list-voices
|
PS> ./list-voices
|
||||||
|
|
||||||
@ -22,9 +22,8 @@ try {
|
|||||||
Add-Type -AssemblyName System.Speech
|
Add-Type -AssemblyName System.Speech
|
||||||
$Synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
$Synth = New-Object System.Speech.Synthesis.SpeechSynthesizer
|
||||||
$Synth.GetInstalledVoices() |
|
$Synth.GetInstalledVoices() |
|
||||||
Select-Object -ExpandProperty VoiceInfo |
|
Select-Object -ExpandProperty VoiceInfo |
|
||||||
Select-Object -Property Name, Culture, Gender, Age
|
Select-Object -Property Name, Culture, Gender, Age
|
||||||
|
|
||||||
exit 0 # success
|
exit 0 # success
|
||||||
} catch {
|
} catch {
|
||||||
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
"⚠️ Error: $($Error[0]) ($($MyInvocation.MyCommand.Name):$($_.InvocationInfo.ScriptLineNumber))"
|
||||||
|
Loading…
Reference in New Issue
Block a user