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