11-06-2022, 02:43 AM
(10-25-2022, 01:21 PM)Spriggsy Wrote: Steve, now you need to do Speech to Text (which PowerShell does support).
I was playing around with this concept a little bit this evening. From what I can tell, it's a worthless endeavor. Try this little powershell snippet out for example (save as something like "Test.ps1").
Code: (Select All)
add-type -assemblyname system.speech
$sp = [System.Speech.Recognition.SpeechRecognitionEngine]::new()
$sp.LoadGrammar([System.Speech.Recognition.DictationGrammar]::new())
$sp.SetInputToDefaultAudioDevice()
$result = $sp.Recognize()
$result
Now, powershell didn't like me just running the file as it exists, so I had to bypass a few security settings with:
Code: (Select All)
powershell -executionpolicy ByPass -File .\Test.ps1
Run it, and you get a blank prompt which basically appears to do nothing. (It's waiting a few seconds for you to talk to it...) Say something, and watch the hilarity ensue as it tries to decipher what you just said.
"Do you understand me at all?":
Code: (Select All)
Audio : System.Speech.Recognition.RecognizedAudio
Alternates : {0, 0, 0, 0...}
Text : Then we now understand me at all
Confidence : 0.08942806
Words : {System.Speech.Recognition.RecognizedWordUnit, System.Speech.Recognition.RecognizedWordUnit,
System.Speech.Recognition.RecognizedWordUnit, System.Speech.Recognition.RecognizedWordUnit...}
Semantics : {}
Homophones : {0, 0, 0, 0...}
Grammar : System.Speech.Recognition.DictationGrammar
ReplacementWordUnits : {System.Speech.Recognition.ReplacementText}
HomophoneGroupId : 0
About 9% confidence that "Then we now understand me at all" is what I said...
And so, I tested it multiple times with a simple "HELLO WORLD" speech... My results were:
Code: (Select All)
Text : A year later in
Text : Al Oleg
Text : The Moraga
Text : The elena's
Text : That illusion were in
5 tries, and as you can see, 5 nonsensical translations of what I said.
Now, is this an issue of a poor microphone? Poor speech training on my PC?
Code: (Select All)
I don't know the problem seems to be that it just doesn't understand me because these last few lines here I dictated flawlessly into Microsoft Word with my same setup on my PC
As it looks to me, Powershell speech-to-text isn't something worth me wasting my time exploring, since it never seems to generate more than an 8% certainty on anything I say.