Tuicemens

Pages: [1] 2

Author Topic: Add Voice Recognition to PCC  (Read 10136 times)

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Add Voice Recognition to PCC
« on: January 08, 2011, 11:28:05 AM »

Many allready know about BVC.
I've been after Bill to add the option to start programs or batch files for years.
This would have expanded PcCompanions possibilities 10 fold, not to mention BVCs possibilities!

Enter WSR Macros! (Windows Speech Recognition Macros)
If you are running Vista or greater you can get PCC to do most anything.
WSR Macros has a wizard that allows you to create macros for a number of predefind things but it also has the option to create custom macros which are merly VB Scripts.
PCC has command line possibilities to send X10 commands, read a weather forecast, speak a Phrase,and a number of other things.
Yes I can go on and the possibilities for me to add more commandline options has grown with the X10Relayer.
This maybe the best program to add to your PC ,WSR Macros.
If you have XP it may just be a reason to Upgrade!
Will this replace BVC? I don't think so but Bill needs to add a few extra features or be able to tie into this somehow.
Windows 7 VR works along side BVC just fine here but others have issues with the two.
There is a site where you can get premade macros  MSDN code library this makes the Windows VR almost as powerful as BVC.

Note: Starting with PCC version 4.0.0.0 Voice recognition is built in.
 (Chr)
« Last Edit: March 12, 2014, 09:19:42 AM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #1 on: January 08, 2011, 01:11:03 PM »

Man I just discovered this from a thread at the BVC forums and installed it this morring.(I have to give credit where it is due)
All I can say is WOW!
I've been playing with this all morning  (RoFL)
PCC just got a unbelieveable power boost!
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #2 on: January 09, 2011, 10:20:22 AM »

For thouse wishing to add this  to PCC:
If you're wondering, How do I add the PCC commands to a WSR Macro?
The steps are easy:
Once installed and running WSR creates a small icon that runs in the system tray.
Right click on the WSR icon and choose New Speach Macro
Click On run a Program
In the next screen type the command you wish to trigger PCC
Next enter the full Path of PCC Default is C:\Program Files\PcCompanion\PcCompanion
Next enter the command line arguments. (These can be found in the new BatchCreator) and must be followed by the repeat value (number of times you wish PCC to run it )

For weather the command would be >Weather?< 0 ( I only want to hear the forecast once) (RoFL)
Click next follow instructions and let windows do its signing!
Once signed and created in the Speach Macro folder your ready to test( don't worry you can edit it after if something isn't just right!)



If your not sure what some of the commands are ( I did post them I believe in the X10 Forums But will get a list posted here soon) Just ask!
If you want PCC to something that it currently can't? Put in a suggestion in the Wish List I will look at the possibility.
 (Chr)
« Last Edit: February 04, 2011, 04:45:32 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #3 on: January 24, 2011, 02:40:30 PM »

You can now execute x10 commands both PLC & RF via WSR Macros as well.
For a complete list of command line Paramiters see PCC commandline options
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #4 on: February 04, 2011, 04:52:27 PM »

Since BVC won't open other Programs (Yet) Use WSR Macros.
You can create one special to open PcCompanion.
Once PcCompanion is open you can tell it to do do any of the functions that there is a button for.
If you want a weather report simply say "weather"
If you want to check your mail say "mail"
Saying "reminder" speaks reminders for the day
To Close PcCompanion Say "close" and so on!
Of coarse you need to be using the windows speach recognition. Good thing Win7 VR works well with BVC! ~:0~
 (Chr)
« Last Edit: March 01, 2011, 09:21:13 AM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #5 on: February 05, 2011, 02:18:45 PM »

I know some of you would like something simular to WSR Macros for XP.
I may look into creating something but it would be a better plug-in for BVC!
XP voice recognition if I remember right would allow for some PCC button triggering. ??? ::)
I'm thinking thats why I had added the code to enable it.
If I can remember and users can confirm this XP VR didn't work well with BVC. ???
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #6 on: February 05, 2011, 05:41:02 PM »

Okay I found something simular to WSR Macros for XP.   `:)
I played with it for only 5 mins and was able to get it to open and close PcCompanion ~:0~
A little more work and it would be possible to do all most any task. ;>
e-speaking if it is worth $15 you be the judge.
You have a 30 day free trial.
 (Chr)
« Last Edit: February 08, 2011, 12:48:11 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #7 on: February 05, 2011, 09:08:49 PM »

Since I'll be using the WSR macros myself I setup a section for Custom macros so users can post any they create which may help others.
You may also post examples/tips tricks you have for e-speeking here as well.
I started one thread for Voice Confirmation a WSR Started hope it helps someone!
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #8 on: February 07, 2011, 05:28:11 PM »

Well I've added some more button names to PCC, this enables them to be triggered via voice!  ;>
For some reason I never did get arround to adding all the button names.
Currently most buttons in the main interface will work Via Voice recognition and about Half the buttons in the floor plan view.
Some of the button names are obvious others not so much.  ::) :`)
I just wish buttons in AHP were able to be voice activated. (cB)
 (Chr)
« Last Edit: March 19, 2011, 12:14:04 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #9 on: March 01, 2011, 09:43:25 AM »

One thing I wasn't happy with while using WSR Macros with PCC.
Well with firing PCC commandline commands in general was the need for a second instance to run!
I've been able to over come that `:) ~:0~
The next release of PCC will no longer need 2 instances enabled. So I've removed that option. ;>
Don't worry your batch files and AHP windows command triggers will still work! ;>
I've opened up a beta test for this build to help debug as PCC code needed to be changed for virtualy every Screen. :-[
True it doesn't have its own VR coded and may never, with espeeking or WSR Macros, Why would I add it?

What can't PCC do Via Voice that you wish it could?
Got a wish?
 (Chr)
« Last Edit: October 25, 2011, 01:53:32 PM by Tuicemen »
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #10 on: March 09, 2011, 10:00:17 AM »

Wish PCC could responded to specific voice commands like some other Software can?
With the new user created command option it is now possible.
The Animated face will even stay in place and speek the text or random text.
True this may take some creativity on your part but it is possible.
Both using WSR Macros and e-speaking.
There may be other programs besides e-speaking that will do this for XP.
Maybe iHouse can be made to do it ???
Itguy or Hawk1 may chime in with an idea (work arround) for iHouse. ???
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

ITguy

  • Full Member
  • **
  • Helpful Rating: 2
  • Offline Offline
  • Posts: 57
Re: Add Voice Recognition to PCC
« Reply #11 on: March 11, 2011, 03:33:04 PM »

It works!!  Pretty cool stuff!  The face syncronization is pretty good, and there's very little delay between the time the macro is triggered and the time PCC starts talking.  Great idea, Tuicemen!!!

Here's what I had to do:

1.  Create an AHK script named PCCsaytext.ahk and compile it to PCCsaytext.exe.  Put it in the iHouse folder.  You would replace the "D:\PcCompanion" with the path to your PCC installation folder. 
Code: [Select]
#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.

run D:\PcCompanion\pccompanion.exe %1%

Use this in the macros.txt file to pass it the text to say:
Code: [Select]
Shell, pccsaytext.exe "test1/test2/test3 0", NormalFocus,DontWait
Notice that you have to follow the PCC rules regarding using either slashes or underscores instead of spaces between words!  And don't forget that 0 to tell PCC to say it just once (or some other number if you want it repeated).

What didn't work:

1. The MS SAPI support for XML strings.  In iHouse, if I use this in a macro:
Code: [Select]
Say, <XML>Hi there</XML> <XML><SILENCE MSEC ="1000"/></XML> it's good to see youthen iHouse says "Hi there", pauses 1 second, then says "it's good to see you".  If I try to pass that string of XML to PCC, then PCC blows up with an "unhandled exception" error.

2.  Using batch files instead of AHK - iHouse only supports .exe for the shell command.

ITguy
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #12 on: March 11, 2011, 04:32:42 PM »

Hey thats good to know!  (GJ)
nice that I wasn't the only one to notice good speed!
Using the batch file isn't the best route to go anyways as it slows things up and takes focus away from what your doing!
The Bat file option was added when AHP couldn't do windows commands properly.
Now with the addition of the user created commands you can add random line reads adding to some unpredicted responces! (RoFL)
Or did you try the commands options like  PcCompanion >Weather?< 0
That should speak the current weather if one had the weather options set.
I've found I could stack 2 text commands and the second would wait for the first to finish
If you got more then 2 in a row the middle ones got lost!  (cB)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!

ITguy

  • Full Member
  • **
  • Helpful Rating: 2
  • Offline Offline
  • Posts: 57
Re: Add Voice Recognition to PCC
« Reply #13 on: March 11, 2011, 06:57:45 PM »

Went back and did additional testing after TJ's and Tuicemen's suggestions over on the iHouse forum.

Quote
I dont see a reason why the Shell command in iHouse shouldnt be able to run a batch file.
And indeed it does!  I tried so many different combinations, I confused myself!  What I should have said was "iHouse shell runs ONLY .bat and .exe files".  It does not run uncompiled .ahk files.  My problem with the .bat files was incorrect syntax passed to PCC, nothing to do with iHouse!
Quote
If Ihouse only supports exe extentions could you not place the commands directly from ihouse with out the use of AHK?
eg:
Indeed I can and did!  Again, a syntax problem.

So here's some samples of what works and what doesn't:

From within an iHouse macro:

Shell, "D:\pccompanion\pccompanion.exe >Weather?< 0", NormalFocus,DontWait
works

Shell, "D:\pccompanion\pccompanion.exe test_test 0", NormalFocus,DontWait
works (PCC speaks "test test")

Shell, D:\pccompanion\test1.bat, NormalFocus,DontWait
works (runs the batch file and PCC does whatever is in the batch file)

From a batch file:
D:\pccompanion\pccompanion.exe [Time?] 0
works (PCC gives the time)

batch file
D:\pccompanion\pccompanion.exe >Time?< 0
doesn't work - notice the >< here instead of the brackets!  From within a batch file, you MUST use the brackets instead!

So there it is.  It works fine -- and it's even more simple than I thought!

ITguy
Logged

Tuicemen

  • Administrator
  • Hero Member
  • *****
  • Helpful Rating: 26
  • Offline Offline
  • Posts: 3711
  • Making Home Automation Fun!
    • Tuicemen.com
Re: Add Voice Recognition to PCC
« Reply #14 on: March 11, 2011, 08:26:49 PM »

Very cool!  ~:0~
Thanks for testing that out!
 (Chr)
Logged
Get the inside scoop and member perks in the
Members Only Section!

Please don't email me Automation questions 
The forum is for that!
Pages: [1] 2