From 1b083b31d6216eacc08298bac540556dd6fb9d38 Mon Sep 17 00:00:00 2001 From: Markus Fleschutz Date: Thu, 16 Sep 2021 08:38:17 +0200 Subject: [PATCH] Update speak-french.ps1 --- Scripts/speak-french.ps1 | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Scripts/speak-french.ps1 b/Scripts/speak-french.ps1 index 75254114..39018253 100644 --- a/Scripts/speak-french.ps1 +++ b/Scripts/speak-french.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 French 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 "*- French*") { continue } $Voice.Voice = $OtherVoice - [void]$Voice.Speak($Text) + [void]$Voice.Speak($text) exit 0 } - write-error "No French text-to-speech voice found - please install one" + write-error "Sorry, no French text-to-speech voice found - please install one" exit 1 } catch { write-error "⚠️ Error in line $($_.InvocationInfo.ScriptLineNumber): $($Error[0])"