mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-03-25 05:26:47 +01:00
Update speak-spanish.ps1
This commit is contained in:
parent
c6d500eeb6
commit
bbae36eaa2
@ -10,7 +10,7 @@
|
||||
.LINK
|
||||
https://github.com/fleschutz/PowerShell
|
||||
.NOTES
|
||||
Author: Markus Fleschutz / License: CC0
|
||||
Author: Markus Fleschutz | License: CC0
|
||||
#>
|
||||
|
||||
param([string]$text = "")
|
||||
@ -21,10 +21,9 @@ try {
|
||||
$TTSVoice = New-Object -ComObject SAPI.SPVoice
|
||||
foreach ($Voice in $TTSVoice.GetVoices()) {
|
||||
if ($Voice.GetDescription() -like "*- Spanish*") { continue }
|
||||
$TTSVoice.Voice = $Voice
|
||||
[void]$TTSVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
$TTSVoice.Voice = $Voice
|
||||
[void]$TTSVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
throw "No Spanish text-to-speech voice found - please install one."
|
||||
} catch {
|
||||
|
Loading…
Reference in New Issue
Block a user