File tree Expand file tree Collapse file tree 21 files changed +88
-88
lines changed Expand file tree Collapse file tree 21 files changed +88
-88
lines changed Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$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
25
25
[void ]$TTS.Speak ($text )
26
26
exit 0 # success
27
27
}
28
28
}
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"
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 16
16
param ([string ]$Name = " " )
17
17
18
18
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" }
20
20
21
21
$Lines = Get-Content - path " $PSScriptRoot /../Data/Checklists/$Name .txt"
22
22
clear-host
Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$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
25
25
[void ]$TTS.Speak ($text )
26
26
exit 0 # success
27
27
}
28
28
}
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"
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$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
25
25
[void ]$TTSVoice.Speak ($text )
26
26
exit 0 # success
27
27
}
28
28
}
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"
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 2
2
. SYNOPSIS
3
3
Speaks text in English
4
4
. 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.
6
6
. PARAMETER text
7
7
Specifies the text to speak
8
8
. EXAMPLE
26
26
exit 0 # success
27
27
}
28
28
}
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."
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 16
16
param ([string ]$File = " " )
17
17
18
18
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" }
20
20
21
21
$Text = Get-Content $File
22
22
Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$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
25
25
[void ]$TTS.Speak ($text )
26
26
exit 0 # success
27
27
}
28
28
}
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."
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$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
25
25
[void ]$TTS.Speak ($text )
26
26
exit 0 # success
27
27
}
28
28
}
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"
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$TTS = New-Object - ComObject SAPI.SPVoice
22
22
foreach ($Voice in $TTS.GetVoices ()) {
26
26
exit 0 # success
27
27
}
28
28
}
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"
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
Original file line number Diff line number Diff line change 16
16
param ([string ]$text = " " )
17
17
18
18
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" }
20
20
21
21
$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
25
25
[void ]$TTS.Speak ($text )
26
26
exit 0 # success
27
27
}
28
28
}
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"
30
30
} catch {
31
31
" ⚠️ Error in line $ ( $_.InvocationInfo.ScriptLineNumber ) : $ ( $Error [0 ]) "
32
32
exit 1
You can’t perform that action at this time.
0 commit comments