Skip to content

Commit 001c19a

Browse files
committed
Update the speak-*.ps1 scripts
1 parent 33a42c2 commit 001c19a

21 files changed

+88
-88
lines changed

Scripts/speak-arabic.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the Arabic text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the Arabic text to speak" }
2020

2121
$TTS = New-Object -ComObject SAPI.SPVoice
22-
foreach ($Voice in $TTS.GetVoices()) {
23-
if ($Voice.GetDescription() -like "*- Arabic*") {
24-
$TTS.Voice = $Voice
22+
foreach ($voice in $TTS.GetVoices()) {
23+
if ($voice.GetDescription() -like "*- Arabic*") {
24+
$TTS.Voice = $voice
2525
[void]$TTS.Speak($text)
2626
exit 0 # success
2727
}
2828
}
29-
throw "No Arabic voice for text-to-speech (TTS) found - please install one"
29+
throw "No Arabic text-to-speech voice found - please install one"
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-checklist.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
param([string]$Name = "")
1717

1818
try {
19-
if ($Name -eq "") { $Name = read-host "Enter the name of the checklist" }
19+
if ($Name -eq "") { $Name = Read-Host "Enter the name of the checklist" }
2020

2121
$Lines = Get-Content -path "$PSScriptRoot/../Data/Checklists/$Name.txt"
2222
clear-host

Scripts/speak-danish.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the Danish text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the Danish text to speak" }
2020

2121
$TTS = New-Object -ComObject SAPI.SPVoice
22-
foreach ($Voice in $TTS.GetVoices()) {
23-
if ($Voice.GetDescription() -like "*- Danish*") {
24-
$TTS.Voice = $Voice
22+
foreach ($voice in $TTS.GetVoices()) {
23+
if ($voice.GetDescription() -like "*- Danish*") {
24+
$TTS.Voice = $voice
2525
[void]$TTS.Speak($text)
2626
exit 0 # success
2727
}
2828
}
29-
throw "No Danish voice for text-to-speech (TTS) found - please install one"
29+
throw "No Danish text-to-speech voice found - please install one"
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-dutch.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the Dutch text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the Dutch text to speak" }
2020

2121
$TTSVoice = New-Object -ComObject SAPI.SPVoice
22-
foreach ($Voice in $TTSVoice.GetVoices()) {
23-
if ($Voice.GetDescription() -like "*- Dutch*") {
24-
$TTSVoice.Voice = $Voice
22+
foreach ($voice in $TTSVoice.GetVoices()) {
23+
if ($voice.GetDescription() -like "*- Dutch*") {
24+
$TTSVoice.Voice = $voice
2525
[void]$TTSVoice.Speak($text)
2626
exit 0 # success
2727
}
2828
}
29-
throw "No Dutch voice for text-to-speech (TTS) found - please install one"
29+
throw "No Dutch text-to-speech voice found - please install one"
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-english.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
.SYNOPSIS
33
Speaks text in English
44
.DESCRIPTION
5-
This PowerShell scripts speaks the given text with an English text-to-speech (TTS) voice.
5+
This PowerShell script speaks the given text with an English text-to-speech (TTS) voice.
66
.PARAMETER text
77
Specifies the text to speak
88
.EXAMPLE
@@ -26,7 +26,7 @@ try {
2626
exit 0 # success
2727
}
2828
}
29-
throw "No English voice for text-to-speech (TTS) found - please install one."
29+
throw "No English text-to-speech voice found - please install one."
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-file.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
param([string]$File = "")
1717

1818
try {
19-
if ($File -eq "") { $File = read-host "Enter path to text file" }
19+
if ($File -eq "") { $File = Read-Host "Enter path to text file" }
2020

2121
$Text = Get-Content $File
2222

Scripts/speak-french.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the French text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the French text to speak" }
2020

2121
$TTS = New-Object -ComObject SAPI.SPVoice
22-
foreach ($Voice in $TTS.GetVoices()) {
23-
if ($Voice.GetDescription() -like "*- French*") {
24-
$TTS.Voice = $Voice
22+
foreach ($voice in $TTS.GetVoices()) {
23+
if ($voice.GetDescription() -like "*- French*") {
24+
$TTS.Voice = $voice
2525
[void]$TTS.Speak($text)
2626
exit 0 # success
2727
}
2828
}
29-
throw "No French voice for text-to-speech (TTS) found - please install one."
29+
throw "No French text-to-speech voice found - please install one."
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-german.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the German text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the German text to speak" }
2020

2121
$TTS = New-Object -ComObject SAPI.SPVoice
22-
foreach ($Voice in $TTS.GetVoices()) {
23-
if ($Voice.GetDescription() -like "*- German*") {
24-
$TTS.Voice = $Voice
22+
foreach ($voice in $TTS.GetVoices()) {
23+
if ($voice.GetDescription() -like "*- German*") {
24+
$TTS.Voice = $voice
2525
[void]$TTS.Speak($text)
2626
exit 0 # success
2727
}
2828
}
29-
throw "No German voice for text-to-speech (TTS) found - please install one"
29+
throw "No German text-to-speech voice found - please install one"
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-greek.ps1

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the Greek text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the Greek text to speak" }
2020

2121
$TTS = New-Object -ComObject SAPI.SPVoice
2222
foreach ($Voice in $TTS.GetVoices()) {
@@ -26,7 +26,7 @@ try {
2626
exit 0 # success
2727
}
2828
}
29-
throw "No Greek voice for text-to-speech (TTS) found - please install one"
29+
throw "No Greek text-to-speech voice found - please install one"
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

Scripts/speak-hindi.ps1

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -16,17 +16,17 @@
1616
param([string]$text = "")
1717

1818
try {
19-
if ($text -eq "") { $text = read-host "Enter the Hindi text to speak" }
19+
if ($text -eq "") { $text = Read-Host "Enter the Hindi text to speak" }
2020

2121
$TTS = New-Object -ComObject SAPI.SPVoice
22-
foreach ($Voice in $TTS.GetVoices()) {
23-
if ($Voice.GetDescription() -like "*- Hindi*") {
24-
$TTS.Voice = $Voice
22+
foreach ($voice in $TTS.GetVoices()) {
23+
if ($voice.GetDescription() -like "*- Hindi*") {
24+
$TTS.Voice = $voice
2525
[void]$TTS.Speak($text)
2626
exit 0 # success
2727
}
2828
}
29-
throw "No Hindi voice for text-to-speech (TTS) found - please install one"
29+
throw "No Hindi text-to-speech voice found - please install one"
3030
} catch {
3131
"⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"
3232
exit 1

0 commit comments

Comments
 (0)