It is currently April 19th, 2024, 6:29 pm

New Plugin: VoiceControl

Share and get help with Plugins and Addons
User avatar
dgrace
Developer
Posts: 265
Joined: June 28th, 2014, 8:32 am
Location: Tokyo, Japan

New Plugin: VoiceControl

Post by dgrace »

After I saw jsmorley's post on text-to-speech stuff, I was spending my Friday night poking around through Microsoft documentation. (who doesn't, right?) And I discovered that they have this whole speech API with voice recognition built into Windows! So I figured hey, that'd be kind of a cool plugin.

It's pretty rough around the edges. Works a lot better if you have the microphone close, like a headset. It's got 2 modes: if you specify a grammar file, it'll try to recognize from a pre-chosen list of text options. If you don't specify one, it'll just try to do its best to figure out what you said. This isn't quite Siri or Cortana here, more like moviefone. But anyway, you can play with it.

Note: you might need to go into your control panel and setup speech recognition to pick the appropriate audio input. If so, just type "speech recognition" into Control Panel and you should see the option there.

Info on the low-level system: https://msdn.microsoft.com/en-us/library/ee125077%28v=vs.85%29.aspx

Enjoy,

dave
You do not have the required permissions to view the files attached to this post.
User avatar
Active Colors
Moderator
Posts: 1251
Joined: February 16th, 2012, 3:32 am
Location: Berlin, Germany

Re: New Plugin: VoiceControl

Post by Active Colors »

This plugin is quite good. Can we teach it to understand simple commands like open or close? Like when I say "Open Notepad" it will launch notepad.exe or after "Close Firefox" it will terminate firefox.exe.
If you are going to spend another night browsing APIs could you check if windows can build waveforms of music files? It would be another great plugin if it could build waveforms from playing music tracks and export it as png with user-defined style.
User avatar
Dank420
Posts: 145
Joined: April 3rd, 2013, 1:04 am
Location: O-High-O

Re: New Plugin: VoiceControl

Post by Dank420 »

AMBITIOUS

Brass ones man, big hairy brass ones.... :thumbup: :thumbup:

having troubles with matchconditions, but thats prob just me , its late and ive been drinking....

Edit:Fun, voiced illustro

Code: Select all

[measureVC_Raw]
Measure=Plugin
Plugin=VoiceControl
GrammarFile=#CURRENTPATH#RmCommands.grxml
IfMatch="computer show Clock"
IfMatchAction=[!ActivateConfig "illustro\Clock" "Clock.ini"]
IfMatch2="computer hide Clock"
IfMatchAction2=[!deActivateConfig "illustro\Clock" "Clock.ini"]
IfMatchMode=0
User avatar
Dank420
Posts: 145
Joined: April 3rd, 2013, 1:04 am
Location: O-High-O

Re: New Plugin: VoiceControl

Post by Dank420 »

[quote="Active Colors"]This plugin is quite good. Can we teach it to understand simple commands like open or close? Like when I say "Open Notepad" it will launch notepad.exe or after "Close Firefox" it will terminate firefox.exe.

seems yes adding the keywords to grxml (open , league in this case) opens League of legends for me

Code: Select all

[measureVC_Raw]
Measure=Plugin
Plugin=VoiceControl
GrammarFile=#CURRENTPATH#RmCommands.grxml
IfMatch="computer show Clock"
IfMatchAction=[!ActivateConfig "illustro\Clock" "Clock.ini"]
IfMatch2="computer hide Clock"
IfMatchAction2=[!deActivateConfig "illustro\Clock" "Clock.ini"]
IfMatch3="computer open league"
IfMatchAction3=["C:\Riot Games\League of Legends\lol.launcher.admin.exe"]
IfMatch4="computer open Radio"
IfMatchAction4=[!togglemeasure Placementstatecalc "DankLaunchers\LauncherTabsStyle\RadioTab" "RadioTabbed List.ini"][!togglemeasure PrevstationPlaycalc "DankLaunchers\LauncherTabsStyle\RadioTab" "RadioTabbed List.ini"]
IfMatchMode=0
not sure of terminate command (drunk, so didnt try that)
im so jazzed..... really hoping this gets more work/development

Edit:interskinbangs it opens my radio, im so damn happy
although when fullscreen (warthunder for test) in another app it opens rainradio for music plays but "Alt tabs" to vlc not sure if its my code or plugin taking font and center control?(probably me)

Edit 2: I wish i wasnt a "totally lazy unwashed spacebum", this is the Shnit that make me love and WANT TO DONATE TO RAINMETER...( thought i couldnt find a path for that either)
...dGrace you roock!!!...
User avatar
StArL0rd84
Posts: 424
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

Re: New Plugin: VoiceControl

Post by StArL0rd84 »

This is just amazing!
Incorporated it in my launcher and i can now open and close the apps with my voice.
Darn lazy mouse hand.

Although inserting the key words into the .grxml file was somewhat a breeze for me, it might not be as easy for someone else.
And some time in the future i want to release the launcher into the wild.

I parsed the .exe name from the file path, using a script, and i am using that as a key word in the.ini file.
I just wonder if there could be a way to somehow auto-write a new line in the .grxml file using the parsed .exe name.

Just want to make it easy on the user of my skin.

Code: Select all

[Variables]
Lpath1=C:\Program Files\Adobe\Adobe Photoshop CS6 (64 Bit)\Photoshop.exe
NirCMD=#@#exe\NirCMD\nircmd-x64.exe

[mPathParser1]
Measure=Script
ScriptFile=#@#lua\PathParser.lua
Input=#Lpath1#
Output=Name
UpdateDivider=-1

[mVoiceControl]
Measure=Plugin
Plugin=VoiceControl
GrammarFile=#@#VoiceControl\RmCommands.grxml
IfMatch="open [mPathParser1]"
IfMatchAction=["#Lpath1#"]
IfMatch2="close [mPathParser1]"
IfMatchAction2=[#nircmd# closeprocess [mPathParser1].exe]
IfMatchMode=0
DynamicVariables=1

Code: Select all

<?xml version="1.0" encoding="utf-8"?>
<grammar version="1.0" xml:lang="en-US" mode="voice" root="rmCommand"
 xmlns="http://www.w3.org/2001/06/grammar" tag-format="semantics/1.0">

  <rule id="rmCommand"> 
    <item>  </item>
    <ruleref uri="#commands"/>
    <ruleref uri="#skins"/> 
  </rule>

  <rule id="commands">
    <one-of>
      <item> open </item>
      <item> close </item>
    </one-of>
  </rule>

  <rule id="skins">
    <one-of>
      <item> Photoshop </item>
      <item> Settings </item>
    </one-of>
  </rule>

</grammar>
([mWorkTime] = 1 ? #Work# : ([mEnergyLoss:%] >= 70% ? #Chillmode# : </>))
User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: New Plugin: VoiceControl

Post by kyriakos876 »

Is there any chance that someone has the source code of this plugin? It has become really slow because Microsoft doesn't really support this API anymore and the plugin became somewhat unstable...
User avatar
Brian
Developer
Posts: 2679
Joined: November 24th, 2011, 1:42 am
Location: Utah

Re: New Plugin: VoiceControl

Post by Brian »

User avatar
kyriakos876
Posts: 919
Joined: January 30th, 2017, 2:01 am
Location: Greece

Re: New Plugin: VoiceControl

Post by kyriakos876 »

Brian wrote: December 27th, 2018, 5:58 am https://github.com/dcgrace/VoiceControl

-Brian
Thanks Brian!