mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-01-23 06:08:36 +01:00
Update the scripts
This commit is contained in:
parent
b653133853
commit
75e2952be0
@ -16,13 +16,12 @@ param([string]$text = "")
|
||||
try {
|
||||
if ("$text" -eq "") { $text = read-host "Enter the English text to speak" }
|
||||
|
||||
$Voice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $Voice.GetVoices()
|
||||
foreach ($OtherVoice in $Voices) {
|
||||
$Description = $OtherVoice.GetDescription()
|
||||
if ($Description -notlike "*- English*") { continue }
|
||||
$Voice.Voice = $OtherVoice
|
||||
[void]$Voice.Speak($text)
|
||||
$CurrentVoice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $CurrentVoice.GetVoices()
|
||||
foreach ($Voice in $Voices) {
|
||||
if ($Voice.GetDescription() -notlike "*- English*") { continue }
|
||||
$CurrentVoice.Voice = $Voice
|
||||
[void]$CurrentVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
throw "No English text-to-speech voice found - please install one"
|
||||
|
@ -16,13 +16,12 @@ param([string]$text = "")
|
||||
try {
|
||||
if ($text -eq "") { $text = read-host "Enter the French text to speak" }
|
||||
|
||||
$Voice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $Voice.GetVoices()
|
||||
foreach ($OtherVoice in $Voices) {
|
||||
$Description = $OtherVoice.GetDescription()
|
||||
if ($Description -notlike "*- French*") { continue }
|
||||
$Voice.Voice = $OtherVoice
|
||||
[void]$Voice.Speak($text)
|
||||
$CurrentVoice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $CurrentVoice.GetVoices()
|
||||
foreach ($Voice in $Voices) {
|
||||
if ($Voice.GetDescription() -notlike "*- French*") { continue }
|
||||
$CurrentVoice.Voice = $Voice
|
||||
[void]$CurrentVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
throw "No French text-to-speech voice found - please install one"
|
||||
|
@ -2,7 +2,7 @@
|
||||
.SYNOPSIS
|
||||
speak-german.ps1 [<text>]
|
||||
.DESCRIPTION
|
||||
Speaks the given text with a German text-to-speech (TTS) voice.
|
||||
Speaks the given text with a German text-to-speech (TTS) voice
|
||||
.EXAMPLE
|
||||
PS> ./speak-german Hallo
|
||||
.NOTES
|
||||
@ -16,13 +16,12 @@ param([string]$text = "")
|
||||
try {
|
||||
if ($text -eq "") { $text = read-host "Enter the German text to speak" }
|
||||
|
||||
$Voice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $Voice.GetVoices()
|
||||
foreach ($OtherVoice in $Voices) {
|
||||
$Description = $OtherVoice.GetDescription()
|
||||
if ($Description -notlike "*- German*") { continue }
|
||||
$Voice.Voice = $OtherVoice
|
||||
[void]$Voice.Speak($text)
|
||||
$CurrentVoice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $CurrentVoice.GetVoices()
|
||||
foreach ($Voice in $Voices) {
|
||||
if ($Voice.GetDescription() -notlike "*- German*") { continue }
|
||||
$CurrentVoice.Voice = $Voice
|
||||
[void]$CurrentVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
throw "No German text-to-speech voice found - please install one"
|
||||
|
@ -16,13 +16,12 @@ param([string]$text = "")
|
||||
try {
|
||||
if ($text -eq "") { $text = read-host "Enter the Italian text to speak" }
|
||||
|
||||
$Voice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $Voice.GetVoices()
|
||||
foreach ($OtherVoice in $Voices) {
|
||||
$Description = $OtherVoice.GetDescription()
|
||||
if ($Description -notlike "*- Italian*") { continue }
|
||||
$Voice.Voice = $OtherVoice
|
||||
[void]$Voice.Speak($text)
|
||||
$CurrentVoice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $CurrentVoice.GetVoices()
|
||||
foreach ($Voice in $Voices) {
|
||||
if ($Voice.GetDescription() -notlike "*- Italian*") { continue }
|
||||
$CurrentVoice.Voice = $Voice
|
||||
[void]$CurrentVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
throw "No Italian text-to-speech voice found - please install one"
|
||||
|
@ -16,13 +16,12 @@ param([string]$text = "")
|
||||
try {
|
||||
if ($text -eq "") { $text = read-host "Enter the Spanish text to speak" }
|
||||
|
||||
$Voice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $Voice.GetVoices()
|
||||
foreach ($OtherVoice in $Voices) {
|
||||
$Description = $OtherVoice.GetDescription()
|
||||
if ($Description -notlike "*- Spanish*") { continue }
|
||||
$Voice.Voice = $OtherVoice
|
||||
[void]$Voice.Speak($text)
|
||||
$CurrentVoice = New-Object -ComObject SAPI.SPVoice
|
||||
$Voices = $CurrentVoice.GetVoices()
|
||||
foreach ($Voice in $Voices) {
|
||||
if ($Voice.GetDescription() -notlike "*- Spanish*") { continue }
|
||||
$CurrentVoice.Voice = $Voice
|
||||
[void]$CurrentVoice.Speak($text)
|
||||
exit 0 # success
|
||||
}
|
||||
throw "No Spanish text-to-speech voice found - please install one"
|
||||
|
Loading…
Reference in New Issue
Block a user