From 443a762a7098f2784b51a6276971146d2dcd61c4 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 16 Sep 2021 08:40:58 +0200 Subject: [PATCH] Update speak-spanish.ps1 --- Scripts/speak-spanish.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/speak-spanish.ps1 b/Scripts/speak-spanish.ps1 index 238e1d59..bb892ab4 100755 --- a/Scripts/speak-spanish.ps1 +++ b/Scripts/speak-spanish.ps1 @@ -11,21 +11,21 @@ https://github.com/fleschutz/PowerShell #> -param([string]$Text = "") +param([string]$text = "") try { - if ($Text -eq "") { $Text = read-host "Enter the text to speak" } + if ($text -eq "") { $text = read-host "Enter the Spanish text to speak" } - $Voice = new-object -ComObject SAPI.SPVoice + $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) + [void]$Voice.Speak($text) exit 0 } - write-error "No Spanish text-to-speech voice found - please install one" + write-error "Sorry, no Spanish text-to-speech voice found - please install one" exit 1 } catch { write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"