mirror of
https://github.com/fleschutz/PowerShell.git
synced 2025-08-10 05:17:44 +02:00
Added close-calculator.ps1
This commit is contained in:
@ -11,7 +11,7 @@ $PathToRepo = "$PSScriptRoot/.."
|
||||
|
||||
try {
|
||||
write-output "Init speech recognition engine..."
|
||||
$null = [Reflection.Assembly]::LoadWithPartialName("System.Speech")
|
||||
[void][System.Reflection.Assembly]::LoadWithPartialName("System.Speech")
|
||||
$speechRecogEng = [System.Speech.Recognition.SpeechRecognitionEngine]::new()
|
||||
#$speechRecogEng.InitialSilenceTimeout = 15
|
||||
$speechRecogEng.SetInputToDefaultAudioDevice()
|
||||
@ -33,6 +33,8 @@ try {
|
||||
$grammar2.Append("exit")
|
||||
$speechRecogEng.LoadGrammar($grammar2)
|
||||
|
||||
write-output "NOTE: make sure the microphone volume is not too silent or too loud!"
|
||||
|
||||
write-output "Listening now ($Count voice commands)..."
|
||||
while ($true) {
|
||||
$recognized = $speechRecogEng.Recognize()
|
||||
|
Reference in New Issue
Block a user