Update the speak-*.ps1 scripts

This commit is contained in:
Markus Fleschutz
2022-09-28 10:03:04 +02:00
parent 4f31313923
commit ea92d28485
16 changed files with 65 additions and 65 deletions

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Danish text to speak" }
$TTSVoice = New-Object -ComObject SAPI.SPVoice
foreach ($Voice in $TTSVoice.GetVoices()) {
$TTS = New-Object -ComObject SAPI.SPVoice
foreach ($Voice in $TTS.GetVoices()) {
if ($Voice.GetDescription() -like "*- Danish*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}