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 Arabic 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 "*- Arabic*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

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
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ("$text" -eq "") { $text = read-host "Enter the English 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 "*- English*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the French 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 "*- French*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the German 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 "*- German*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Greek 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 "*- Greek*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Hindi 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 "*- Hindi*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Italian 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 "*- Italian*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Japanese 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 "*- Japanese*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -1,6 +1,6 @@
<#
.SYNOPSIS
Speaks text with a Latin text-to-speech voice
Speaks text in Latin
.DESCRIPTION
This PowerShell script speaks the given text with a Latin text-to-speech (TTS) voice.
.PARAMETER text
@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Latin 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 "*- Latin*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Mandarin 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 "*- Mandarin*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Polish 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 "*- Polish*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Portuguese 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 "*- Portuguese*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Spanish 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 "*- Spanish*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Swedish 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 "*- Swedish*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}

View File

@ -18,11 +18,11 @@ param([string]$text = "")
try {
if ($text -eq "") { $text = read-host "Enter the Ukrainian 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 "*- Ukrainian*") {
$TTSVoice.Voice = $Voice
[void]$TTSVoice.Speak($text)
$TTS.Voice = $Voice
[void]$TTS.Speak($text)
exit 0 # success
}
}