speak scripts for Windows

This commit is contained in:
Nicholas Albion
2023-06-01 22:45:00 +10:00
parent 3f7436e8a0
commit 5b9e59bc07
10 changed files with 33 additions and 7 deletions

View File

@ -0,0 +1,12 @@
# Set-ExecutionPolicy -ExecutionPolicy Bypass -Scope CurrentUser
param(
# voice options are David or Zira
[Parameter(Mandatory=$true)][string]$voice,
[Parameter(Mandatory=$true)][string]$text
)
Add-Type -AssemblyName System.Speech;
$speak = New-Object System.Speech.Synthesis.SpeechSynthesizer;
$speak.SelectVoice("Microsoft $voice Desktop");
$speak.Rate="0";
$speak.Speak($text);