![]() |
Quote:
|
Quote:
1. First you speak an initialization command such as "recognize 6 tube configuration" or simply "i have 6 tubes". This would set a variable that would help it keep track of how many cycles are needed to reach a given tube. 2. In the config files I would add something like "open tube 1" through "open tube 10" and the "key sequence" would not be a normal one, but rather something special that would instruct the script to first A.) check the current tube configuration, B.) cycle n tubes, open, and stay there (since you usually press Fire right after.) So, if you're on a 10 tube boat and open/fire tube 7, then say open tube 2, it would know to cycle 5 times, since it knows you're on 7, since it put you there initially with an earlier command. 3. It would also need to start with the assumption that all tubes are closed and that it will always control opening and closing of tubes. This way, if you say "open" and it's already open, it won't toggle it and cause it to close. This not only solves the problem that there doesn't seem to be a way to map a key to these tubes, but it will probably work extremely well, assuming the game reacts to rapid-fire tube cycling (if not, we can always add a delay since this whole command sequence is somewhat special.) The only drawback is that it would require that you never use the mouse or keys to select tubes, or if you do, you'd need to remember to select tube 1 before using the voice command. |
Just posted a quick 1.2 version with bugfixes for the multi-key sequences and debug output since it was horribly broken. See what happens when you don't bother to test? :damn:
See first post at top of thread for download link/readme |
Just posted 1.3 with tube door management!
Amazingly the entire codebase for both scripts is only 391 lines, and that includes a lot of whitespace. God I love Perl. |
Thank you for this unbelievebale Mod. Is there a chance for a german version?
|
Quote:
I see no reason others couldn't localize the CSV files and post them. If someone did I'd be happy to include it in the ZIP. Some minor changes might be required to the code but I doubt it. You choose the language of the speech recognizer in Control Panel > Speech and I don't think the code cares what language you're in. You might even be able to get away with using phonetic equivalents of german words in the CSV file. For "command room" as "Befehl Raum" you could try "befell raum" or "befell roam" for example. |
Wouldn´t this require a german sdk version?
|
Quote:
the output of the commands is as follows.. 1st) perl go.pl: Code:
sh4speech 1.3 by Minsc (Erik Knepfler) Code:
Traceback (most recent call last): |
Quote:
|
Just added a prioritized TODO list to the top-level post.
UPDATE: I just spent some time in Vista trying to get this to work. Epic failure. hear.py looks like it needs some serious work for Vista. I made a little progress with some guesswork but I think the fundamental approach of using COM dispatching to hook into SAPI is just no good. The Vista stuff claims to be backward compatible but I'm not seeing it. If someone wants to tackle this, just google some of the unique comments in hear.py to find the original work and maybe harass the author. Or, find a simple working python example of a listener that repeats your spoken commands (no matter how badly, it just needs to be hooked into the CSVs) and I'll do the rest. Sorry! Really, nobody should be playing SH4 in Vista anyway... it kills your FPS you know.) |
minor tube bug
Noticed a minor tube bug very late last night, I was too tired to fix it. I'm going to update the zip with this, but here it is for now in case this is bothering anyone:
Problem: If you're on tube 3 (which sh4speech knows) and you load a game or otherwise reset things, you'll be on tube 1. When you use the tube reset command "set all tubes closed" it still thinks you're on tube 3 and when you use any tube command it will use the wrong tube every time from that point forward. Solution: Set the internal "current_tube" variable to 1 when "set all tubes closed" command is issued. Code patch (insert as line 160. should be inside the ALLCLOSE if block) $VARS{"current_tube"} = 1; So that general area should look like: Code:
|
hey guys!
I've found a simple solution that not only increases the recognition speed by about 10x, but also eliminates the extra window. I'll have that in tonight, along with the tube fix above. The 100x improvement is just the time between when the Python script catches it to when the Perl script notices it, which is already only about 1/10th of a second, but now it will be 1/100th of a second. It also fixes the rare chomp() error that causes the Perl script to not catch the command from the Python script. I can't believe I didn't do this to begin with, it solves so much.
Keep in mind the biggest factor in the speed of recognition is the settings in Control Panel > Speech. There's a slider that says fast/loose or slow/accurate. Try to make it fast but test test test... |
1.35 posted
v1.35 posted.
http://knepfler.com/sh4speech1.35.zip 1.35 Minor enhancement and bugfixes Bugfixes: "set all tubes closed" now sets the current_tube variable to 1 since loading a savegame, docking, or any other condition that causes you to use this command probably means it's not still on tube 3 or whatever your last tube was. Enhancements: Added "reset tubes" and "reset all tubes" voice command alias for "set all tubes closed" since that makes more sense. Eliminated python popup window by using command line pipe redirection instead Increased recognition speed from a polling rate of 10x per second to instantaneous with above trick Both programs must now terminate together which is nice, since sometimes various restarts would result in two hear.py's running Removed some extraneous junk files from the package, including wxPython which is actually not needed. Drastically shrinks the ZIP size too Compatibility: Two voice command aliases added for id #95 (just some tube reset commands) |
v1.38 posted, more minor fixes.
|
Hello!,
I really want to try this out but am having major ( or possibly minor) install problems. My problem seems to be the same that panthercules had in his 7/31/07 post. The program doesn't recognize or install GUITest . Here is what it looks like when i try to install..... Starting wxPython install The system cannot find the path specified. Installing additional perl modules No missing packages to install No missing packages to install ppm install failed: 404 File `\sh4speech\libraries\Win32-GuiTest\Win32-GuiTest.p pd' does not exist File not found - SAPI5.pm A subdirectory or file \perl\site\lib\win32 already exists. A subdirectory or file \perl\site\lib\win32\guitest already exists. The system cannot find the path specified. The system cannot find the path specified. Everything should be done now. Press any key to continue . . . I tried to do all the fixes that you suggested to him but i continue to have the same problem. I am not a computer whiz ( wish i was) but i enjoy and appreciate all the work modders like yourself do...I hope yiou can help because i said all along that voice recognition is all the SH4 needed to be complete...would love to try this out...Thanks!!! |
All times are GMT -5. The time now is 10:41 AM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.