View Full Version : [REL] sh4speech - voice command for SH4
minsc_tdp
07-28-07, 05:28 PM
shSpeech - Voice Command for Silent Hunter 4 by minsc_tdp
sh4speech is a voice command program for Silent Hunter 4, but could be adapted to other games (and has been adapted to SH3 now!) It currently supports everything the game can do, allowing you to issue all orders completely hands-free, which frees up your mouse to only manipulate the cameras and periscope, map, and other things that traditionally did not involve spoken orders.
It is extremely quick, responsive, reliable, and the recognition is great if you follow the readme and spend a few minutes training your speech system and if you adjust your microphone often. The first time you hear someone bark "Yes sir!" in response to an order you barked yourself at your crew, your whole SH experience will change forever! :)
Downloads
v2.55 ***LATEST GOOD VERSION*** aka "DON'T STOP BELIEVIN' RELEASE
Download page: http://knepfler.com/shSpeech (http://knepfler.com/shSpeech)
Silent Hunter 3
TomcatTwo modded this to work with Silent Hunter 3. To be honest, he put my work to shame! He added a lot of commands, even in German, and his documentation and immersion level is outstanding! Check it out here (http://www.subsim.com/radioroom/showthread.php?t=132228). I'm glad to have contributed the core technology to this awesome project. Congratulations TomcatTwo on an awesome release!
Latest Changes
June 29, 2016 (2.55 aka "DON'T STOP BELIEVIN RELEASE") - Added tmo 2.5 files by razark
Mar 01 2008 (2.54) - Fixed resolution scaling problems for TomcatTwo's SH3 mod (dials should work better in this one vs. 2.53)
Mar 01 2008 (2.53) - Fixed resolution scaling problems for TomcatTwo's SH3 mod
Feb 23 2008 (2.52) - Added "Pause Recognition" and "Resume Recognition" commands with underlying code support
Feb 19 2008 (2.51) - Added additional launch BAT files for left-handed users with underlying code support. Untested.
Feb 13 2008 (2.50) - Important adjustments made to location of voice_commands.csv and press_to_talk.csv files. If you have customized your CSV files, you must read the ChangeLog! (http://knepfler.com/shSpeech/ChangeLog.htm) Other minor adjustments nobody will really notice.
Feb 9 2008 (2.25) - Fixes a problem where extra spaces at the end of voice commands would cause them to not work
Feb 5 2008 (2.24) - Adds support for multiple "hold keys", so you can do CTRL-SHIFT-ALT-X instead of being limited to only one, where you could only do CTRL-X or SHIFT-X or ALT-X. See the ChangeLog (http://knepfler.com/shSpeech/ChangeLog.htm) for full explanation.
See the full changelog for a complete history of changes. (http://knepfler.com/shSpeech/ChangeLog.htm)
Docs
Readme (http://knepfler.com/shSpeech/ReadMe.htm)
ChangeLog (http://knepfler.com/shSpeech/ChangeLog.htm)
Voice Command Reference Card (http://knepfler.com/shSpeech/Reference_Card.htm)
Videos
http://knepfler.com/shSpeech (http://knepfler.com/shSpeech)
URLs
Older Thread: http://www.subsim.com/radioroom/showthread.php?t=119039
corleonedk
07-28-07, 06:43 PM
I take my hat of for you m8,its late now but will test this tommorow..Well done :up:
minsc_tdp
07-28-07, 07:01 PM
I've been playing with it for more than an hour or so. DAMN is it fun! Hasn't misinterpreted a single command. Did a convoy kamikaze mission to stress it out. Only a very small number of commands went unheard, such as "hard to port" for some reason (probably due to the rough T sounds), but usually only when stuff on my boat was exploding, which I find very realistic! The recognition and response is very quick. I can't wait to set up shooting solutions with it. I'm playing with a nice mic about 1.5 feet from my mouth on the desk, and it works great even with 5.1 sound blaring throughout the room and my brother's stereo cranked in the next room.
panthercules
07-29-07, 01:19 AM
Man - that was quick work - I can't wait to plow into this. I got my new PC built and so far so good on it (doubled fps on my SH4 benchmark :D ), but have run into a little trouble on one of the other 3 I'm upgrading so it will still probably be tomorrow night or later before I can get back and test this out. Early reports from the posts above are certainly encouraging.
Thanks for hanging with this :up:
minsc_tdp
07-29-07, 05:39 AM
I've updated some critical install information to help you get things running. Let me know if there's any problems! God I'm so drunk right now I can't believe I'm posting this. The world is a total blur.
UPDATE: Now sober, I've tweaked the install instructions again and matched up the readme.txt instructions in the download with the instructions in the thread here.
panthercules
07-29-07, 01:56 PM
Got some time while one of the other PCs is installing windows and was going to start playing around with this, but I'm confused by the install instructions. The first post above states:
2. Start > run > \sh4speech\install.bat. This will start the install for:
ActivePerl
...
I've downloaded ActivePerl and Active Python from the links you provided, but I haven't installed them yet (I'd already downloaded and installed the MS SDK thing a few days ago). Does the statement above mean that your bat file installs ActivePerl and/or ActivePython, or do I need to have installed ActivePerl and Active Python from the downloads first before I start running your install.bat file?
minsc_tdp
07-29-07, 05:10 PM
Sorry, no you have to install ActivePerl & ActivePython yourself. The install.bat was going to do it but it made the zip too big so I dumped them. Normal installs on both is fine. Same for the Microsoft SAPI 5 SDK. After installing all those, run install.bat.
ReallyDedPoet
07-29-07, 05:32 PM
Nice to have this option :yep: Great work here :up:
RDP
Digital_Trucker
07-29-07, 06:02 PM
Oh, boy! New toy to play with. :up: Thanks!
My wife will be wondering who I'm yelling at soon.
panthercules
07-29-07, 07:18 PM
Although I'm pretty sure I followed all the directions for the install, I've got a weird error problem trying to run this - when I try to do the test mode, I get the following message:
"Can't locate Win32/GuiTest.pm in @INC <@INC contains: C:/Perl/site/lib .> at go.pl line 9.
BEGIN failed--compilation aborted at go.pl line 9."
When I searched for GuiTest.pm, I found it in C:\sh4speech\libraries\Win32-GuiTest
There we an awful lot of questions during the ActivePerl and/or Active Python install processes - I just picked the default answers (except where I had to answer "yes" to the license questions), but maybe something went wrong anyway - any idea what this error is all about? Is there some trick to installing those Active things that maybe I missed?
[edit] - I re-ran the installs of ActivePerl and ActivePython (picked "repair" option in the latter) - everything seemed to go just fine. However, when I run either the test mode batch file or the main start batch file, I still get the same error message noted above. BTW - I did also do the step no. 3 in the notes on the first post (with the PythonWin editor) and all the other training/calibration steps before the first time I tried to run the batch files. Any ideas?
[edit] well, I also re-ran the sh4speech install.bat, just in case - everything appeared to go fine with that as well, but again I still get the same error message when I run the test mode :(
Any ideas welcome - would really like to give this a whirl
minsc_tdp
07-29-07, 09:51 PM
"Can't locate Win32/GuiTest.pm in @INC <@INC contains: C:/Perl/site/lib .> at go.pl line 9.
BEGIN failed--compilation aborted at go.pl line 9."
Look inside the install.bat and you'll see a line that looks like this:
ppm install \sh4speech\libraries\Win32-GuiTest\Win32-GuiTest.ppd
Put that into a command prompt and see what happens. It should install that module which is not installed on your system for some reason, see why when you run it manually. The results should look like this:
C:\Documents and Settings\you>ppm install \sh4speech\libraries\Win32-GuiTest\Win32-GuiTest.ppd
Unpacking Win32-GuiTest-1.50.5...done
Generating HTML for Win32-GuiTest-1.50.5...done
Updating files in site area...done
16 files installed
You might want to copy everything from C:\sh4speech\libraries\Win32-GuiTest into c:\temp and then try
ppm install \temp\Win32-Guitest.ppd
I've noticed it didn't install once from a deep folder but from there it was OK.
If all else fails, add this to the install.bat and run it again:
md \perl\site\lib\win32
md \perl\site\lib\win32\guitest
copy \sh4speech\libraries\Win32-GuiTest\GuiTest.pm \perl\site\lib
copy \sh4speech\libraries\Win32-GuiTest\lib\win32\guitest\*.* \perl\site\lib\win32\guitest
If it's STILL not workin do this on a command prompt and tell me the results:
perl -e "print join(',', @INC);"
Mine returns this, as should yours:
C:/Perl/site/lib,C:/Perl/lib,.
panthercules
07-29-07, 11:49 PM
snakebit I guess - did all the steps you suggested above (thanks for the detailed instructions, BTW).
Every step along the way resulted in exactly the results you indicated should happen.
BUT, when I try to run the test mode batch file, I now get the following error:
"Can't locate Win32/API.pm in @INC <@INC contains: C:/Perl/site/lib .> at go.pl line 12.
BEGIN failed--compilation aborted at go.pl line 12"
So close, and yet so far :cry:
Any other suggestions?
minsc_tdp
07-30-07, 12:24 AM
"Can't locate Win32/API.pm in @INC <@INC contains: C:/Perl/site/lib .> at go.pl line 12.
BEGIN failed--compilation aborted at go.pl line 12"
That's good, you've made progress, you got Win32-GuiTest to install and work. Line 12 invokes Win32-Api which the install.bat also should have installed.
What happens at a dos prompt when you type:
ppm install Win32-API
It should download the module from the 'net automatically and install it. I'm thinking maybe ppm isn't running for some reason. PPM is the Perl Package Manager that installs such libraries from an online repository called CPAN. ppm is completely self-sufficient and knows how and where to download stuff from and how to install it.
Worst case, you could download http://knepfler.com/Win32-API.zip and unzip it to \perl\site\lib\win32
Chat online with me if you're still stuck, I'll be around for a little bit. Early night though, 6 AM flight.
aim: erikdotla
icq: 1352055
yahoo: minsc_tdp
minsc_tdp
07-30-07, 12:40 AM
I hope nobody is discouraged from the install troubles some are having. I've never had trouble getting things to install with PPM on dozens of systems and I didn't expect any trouble here. I might consider an alternate install-manual.bat which manually puts the files where they need to be instead of relying on PPM. While there's no simple one-click EXE install for this, this is really not very painful compared to most applications out there, and it's worth the work so I hope you all give it a shot.
Seeing how this is really one of the very few applications that I've written, properly documented, and released to the public, I'm very proud of it even though it is relatively simplistic. I intend to support it indefinitely and I'll personally help anyone bring this online who is having trouble. Just post here!
I've also just updated the install.bat in the ZIP to hopefully take care of some of these problems, by trying every module install twice, once by calling PPM, and once by calling PPM specifically with the path where it should be (\perl\bin). Hopefully you've installed Perl to c:\perl or \perl (root of your windows drive.)
panthercules
07-30-07, 01:00 AM
AWESOME - thanks for babying me through this - I tried just D/L'ing your program again to try the new install.bat file, but that didn't work.
then I tried the part where you said:
"What happens at a dos prompt when you type:
ppm install Win32-API"
That did the trick - it did what you said it should, and now running the test mode script calls up the window and starts recognizing the voice commands - unfortunately it's too late to stay up and play with it, but hopefully the hard part is over and it'll be fun time tomorrow night (darn RL work gonna get in the way first :cry: )
Thanks again - can't wait to take her for a spin :up:
[edit] Couldn't resist checking out the voice command file for a bit to see how easy it is to insert your own commands - turns out it's remarkably easy. This is set up really well - kudos :up:
I added several of my preferred ways of saying some commands, sometimes replacing some of the stock ones and sometimes adding some more, and they all worked flawlessly in the test mode - well done :rock:
Now, only one more request to bother you with before I head out to sea with this tomorrow - I tried to figure out how to change the key for "fire" from "Enter" to "Ctrl+Enter", since I don't use "Enter" to fire torps (a little lesson learned from accidental firings in SH3), but I wasn't sure about the interplay between the two key-related .csv files (may just be late and I wasn't thinking straight) and I didn't want to screw something up now that I finally got the test mode thing working. Any chance you could post an explanation on how to change the keystroke outputs for this? If not, I'll try reading it all again tomorrow night when I've gotten some sleep - it's probably in there already and I'm just missing it.
Thanks again for this - gonna be great fun, especially if/when you get the mouse/course and depth stuff working :up:
minsc_tdp
07-30-07, 01:44 AM
I tried to figure out how to change the key for "fire" from "Enter" to "Ctrl+Enter", since I don't use "Enter" to fire torps
Pretty easy:
add this to key_codes.csv
CTRL-ENTER,0xA2+0x0D,0x00
As you'll notice from other lines near the bottom of that file, 0xA2 is obviously CTRL and ENTER is already defined up above as 0x0D. You can combine up to two keys using + in this way. Codes for SHIFT and ALT and anything else I forgot can be found here: http://delphi.about.com/od/objectpascalide/l/blvkc.htm (just preface all with 0x)
Next, in key_commands.csv, change the line:
12,Key,Fire,ENTER
to
12,Key,Fire,CTRL-ENTER
Since CTRL-ENTER matches the entry in key_codes.csv, that's it, you're done!
These are separate from voice_command.csv so that you can add a dozen voice commands for "fire" without worrying about putting in the right key. It's all documented at the bottom of the readme (though I realize I forgot to include the URL for the key codes... I've updated the readme.txt with this and also included links in a "docs" subfolder in the zip.)
minsc_tdp
07-30-07, 01:52 AM
AHA! I'm 99% sure I've fixed the installer problems. There were two: First, one command was prompting an invisible question which would stick the bat to prevent you from reaching the next step. Second, since I'm running PPM which is actually a bat file from within another bat file, it's best to use the "call" prefix. So I'm quite sure these installer problems will go away for anyone else.
panthercules
07-30-07, 11:43 PM
I tried to figure out how to change the key for "fire" from "Enter" to "Ctrl+Enter", since I don't use "Enter" to fire torps
Pretty easy:
add this to key_codes.csv
CTRL-ENTER,0xA2+0x0D,0x00
Great - thanks - I had the first part figured out, but I wasn't sure what the last column (0x00 above) should be (wasn't sure what a scan code was or how to figure out what the scan code should be).
Had to help someone do something tonight, so didn't get any sub time in tonight :(
Will have to try this out on patrol tomorrow - Now that I got my RFB install tweaked up I'm really looking forward to testing it out with this voice thing. Thanks again!
panthercules
07-31-07, 12:22 AM
Just did some more testing (just in test mode) to check the key change for firing - looks like it's going to work great.
This is going to be very cool - I really like being able to have multiple voice comands assigned to the same key/action, especially for things like diving (I've added "Clear the bridge" and "Lookouts below") and firing each tube. I know you still have to work a bit on the tube selection aspect, but I went ahead and set it up so "Fire one", Fire two", Fire three", etc. up to "Fire ten" all work, so I can now order the crew to fire the correct tube (assuming I've selected the right tube before I say it :D )
I hope there's a way to map a key/combo to open a specific tube door or doors - I'd love to be able to say "make ready all bow tubes", or "open outer doors on tubes 1 and 2" and have it actually work. I never really played using the keyboard much unless I had to (tried to use the mouse on everything possible) - with this though I'm going to have to rethink that, and check into all the possibilities of assigning keys to things I never would have messed with before.
Is there a list somewhere of every action that folks have figured out can be mapped to keys? That would be really handy for working with this speech thing (for example, can you map the weather report function to a key, or just to a button on the orders bar? - it would be great to be able to ask your watch officer for a weather report by voice command).
Just did some more testing (just in test mode) to check the key change for firing - looks like it's going to work great.
This is going to be very cool - I really like being able to have multiple voice comands assigned to the same key/action, especially for things like diving (I've added "Clear the bridge" and "Lookouts below") and firing each tube. I know you still have to work a bit on the tube selection aspect, but I went ahead and set it up so "Fire one", Fire two", Fire three", etc. up to "Fire ten" all work, so I can now order the crew to fire the correct tube (assuming I've selected the right tube before I say it :D )
I hope there's a way to map a key/combo to open a specific tube door or doors - I'd love to be able to say "make ready all bow tubes", or "open outer doors on tubes 1 and 2" and have it actually work. I never really played using the keyboard much unless I had to (tried to use the mouse on everything possible) - with this though I'm going to have to rethink that, and check into all the possibilities of assigning keys to things I never would have messed with before.
Is there a list somewhere of every action that folks have figured out can be mapped to keys? That would be really handy for working with this speech thing (for example, can you map the weather report function to a key, or just to a button on the orders bar? - it would be great to be able to ask your watch officer for a weather report by voice command).
Yes all of that is possible and more. Have a look in the Commands.cfg file. There are a ton of commands that are functional but never mapped to a key. I have'nt fully customized my SHIV file yet, but in SHIII I had nearly 3 full keyboards of commands (using shift/control), just so I could issue orders verbally using Shoot. I am just the opposite of you when it comes to the mouse. Mouse clicking kills immersion for me. I try to only use the mouse to look around. I use a number of multiple commands for one phrase also. Here are a few from SHIII:
"Lower all masts" - both scopes & snorkel are lowered.
"Prepare to dive" - all masts are lowered & tubes closed & dive ordered.
"Silent running" - silent running is ordered & gramophone turned off.
"At ease men" - secure from silent running & the gramophone switched back on.
"Emergency Surface" - blow ballast-go to flank speed-surface-blow ballast.
I even mapped timed inputs for the arrow keys to walk the Free camera from one station to the next, climbing ladders & going through hatches and so forth based on a verbal command. Below are a few snippets from Commands.cfg
[Cmd315]
Name=Select_tube_1
Ctxt=1
[Cmd316]
Name=Select_tube_2
Ctxt=1
[Cmd317]
Name=Select_tube_3
Ctxt=1
[Cmd318]
Name=Select_tube_4
Ctxt=1
[Cmd319]
Name=Select_tube_5
Ctxt=1
[Cmd320]
Name=Select_tube_6
Ctxt=1
;NAVIGATION OFFICER
[Cmd250]
Name=Navigation_officer
Ctxt=1
GoBack=Navigator_view
[Cmd251]
Name=Choose_destination_point
Ctxt=1
[Cmd252]
Name=Plot_course
Ctxt=1,11
MnID=0x3F060001
[Cmd253]
Name=Return_to_course
Ctxt=1
Key0=0x56,C,"V"
MnID=0x3F060004
[Cmd254]
Name=Search_pattern_1
Ctxt=1
MnID=0x3F240002
[Cmd255]
Name=Search_pattern_2
Ctxt=1
MnID=0x3F240003
[Cmd256]
Name=Search_pattern_3
Ctxt=1
MnID=0x3F240004
[Cmd257]
Name=Report_time_to_turn
Ctxt=1
Key0=0x4e,Cc,"Ctl+N"
MnID=0x3F250002
[Cmd258]
Name=Report_time_to_course_end
Ctxt=1
MnID=0x3F250003
[Cmd259]
Name=Report_range_to_course_end
Ctxt=1
Key0=0x42,Cc,"Ctl+B"
MnID=0x3F250004
[Cmd260]
Name=Report_depth_under_keel
Ctxt=1
Key0=0x42,C,"B"
[Cmd261]
Name=Report_weather
Ctxt=1
Key0=0x56,Cc,"Ctl+V"
MnID=0x3F250006
Like I said I'm just getting started customizing my SHIV.
minsc_tdp
07-31-07, 09:40 PM
I'll have to add some basic pausing so that you can issue two keys or a series of keys with one command... should be very easy.
Nice work minsc_tdp. Were you able to get the mouse inputs going, or is this still in progress?
Thanks
panthercules
08-01-07, 12:23 AM
OK - I'm still not following one aspect - what exactly is a "scan code" (third column in the key_codes.csv file) and how do I know what it's supposed to be.
I'm trying to add a command for opening/closing the recognition manual, which is assigned to the "N" key in game. So, I went to the website linked to above, and found that the code for the "N" key is 4E. So, I started adding an entry to the bottom of the key_codes.csv file file, as "N | 0x4E | ???", but I can't figure out what belongs in that third column as the "scan code".
Making the changes to the key_commands.csv file seemed easy enough (presumably "59 | Key | Recognition Manual | N"), as did the changes in the voice_commands.csv file (presumably "59 | Recognition manual | Recognition manual"), but this "scan code" thing has me stumped - I couldn't detect any pattern in looking at the scan codes for the other entries in the key_codes.csv file, but then again I'm a total noob at hex stuff so I probably wouldn't be able to spot a pattern even if there is one.
Have I read right past this part in the previous explanations, or can you shed some light on how to determine what the entry in the scan code column should be for new commands we add?
[edit] OK - I still don't know what a scan code is, but I had to put something in there when I closed the files, so I just chose "0x00" like you suggested in the example about "CTRL-ENTER". This seemed to work in test mode - when I say "Recognition manual" it says it recognizes it and that it's outputting the letter "N", so I guess it worked - but if 0x00 always works, why are all the other scan codes something else? What is a scan code and what does it do?
minsc_tdp
08-01-07, 12:19 PM
Well I thought I needed the scancodes and I entered them all in. Then I noticed I got some of them wrong due to being an idiot and using multiple info sources for the scan codes. Then I noticed that they tended to actually screw up the function call so I just zeroed it out in the code. Therefore it basically ignores whatever you put in that field (but it's best to put something like 0x00 to prevent warnings about empty variables and such.)
I still haven't got the mouse stuff started, I'm on vacation in TN all week. But I can't resist checking in here :)
minsc_tdp
08-01-07, 12:31 PM
I did notice that it seemed to have a little more trouble recognizing commands in game than it had in the test mode - I suppose that's a natural consequence of having the game competing for priority or something.
panther noted the above in a PM and I think I have a suspicion of what's going on. Also y'all might have seen funky error messages from time to time that aren't repeatable, as in, they go away when you just say the command again.
I think the reason is that the python listener writes a file anytime an event is fired for the voice rec. This can happen at any moment. The perl script scans the file written by python, but to do this needs to open it, and if the python is writing to it at that exact moment, the file is locked, it throws an error and misses the command. For now I'll just hack this so that it detects this condition and retries until it's unlocked. The right solution is to have the two programs communicate with a better system than reading and writing files. Maybe the registry or a local IP port. I'm not much of a python coder but I'll figure something out.
Fraggulus
08-01-07, 03:26 PM
Hi, I got some troubles installing the ActivePerl. I downloaded the file and unzipped it. But executing the Installer.bat always shows this error message:
Can't locate warnings/register.pm in @INC (@INC contains: C:/Perl/Perl/lib .) at C:/Perl/Perl/lib/vars.pm line 7.
BEGIN failed--compilation aborted at C:/Perl/Perl/lib/vars.pm line 7.
Compilation failed in require at C:/Perl/Perl/lib/base.pm line 4.
BEGIN failed--compilation aborted at C:/Perl/Perl/lib/base.pm line 4.
Compilation failed in require at C:/Perl/Perl/lib/ActiveState/Prompt.pm line 7.
BEGIN failed--compilation aborted at C:/Perl/Perl/lib/ActiveState/Prompt.pm line 7.
Compilation failed in require at Installer.bat line 47.
BEGIN failed--compilation aborted at Installer.bat line 47.
What am I doing wrong? (The os is Win Vista Premium)
thx for any help!
moselgott
08-02-07, 09:26 AM
Hi all, Iīve got a little problem, too!
I followed all the instructions and everything was fine so far. All installing, adjusting the microphone, no problem at all. But then I wanted to start the programm
( Run "sh4speech.bat" to start the program.
When you run it, it will open a new window that says "Listening for voice commands from voice_commands.csv".)
the window opens only for less than a second and immediately closes again. Nothing happens furtheron (I think I should be able to give to commands in SH4 then, but Iīm not)
Does anyone know what I did wrong / can do now?
Thanks a lot, moselgott!
EDIT: Ok, I made that window run entering "hear.py" instead of "sh4speech.bat". So that window appears with the sentence "listening for phrases from voice_commands.csv", and commands like "map" or "dive" appear there if I speek into the microphone. So I started SH4 parallel to that window and gave several commands, but nothing happened. I went back to desktop and the window showed up with all the commands I gave while Sh ran. What do I do wrong!?!?!?
Any ideas?
moselgott
08-03-07, 07:13 AM
Noone? Iīm really desperate because I donīt manage to achieve anything...:cry:
panthercules
08-03-07, 06:27 PM
Noone? Iīm really desperate because I donīt manage to achieve anything...:cry:
Unfortunately, I don't have much idea how this thing minsc did really works. We'll probably have to wait till he gets back from his trip, or gets another chance to get online from where he is now.
However, I did the same thing you did and I noticed that while it opens up the one window that repeats the commands you say, it doesn't open up the other window that opens up when I use the sh4speech.bat file - it's that second window that appears to output the key commands that are spawned by your spoken commands, and without those key commands getting output, you're not going to see any effect in the game of speaking the commands.
I noticed that when I first tried this I was getting the same "fleeting window" issue you describe - the window closes too fast to be able to tell what error message you're getting so it's hard to track down the problem. One thing you should try - run the sh4speech.bat file from a DOS command prompt box instead of from a shortcut in Windows - that way, since the DOS/command prompt window stays open, you should be able to read what error message you get when sh4speech.bat fails - depending on what that error message is, we might be able to figure out how to fix it (if it's the same message I was getting, as outlined in some of the posts above) or at least minsc might be able to give you a solution when he sees it.
Good luck!
minsc_tdp
08-03-07, 11:16 PM
Hi, I got some troubles installing the ActivePerl
First, I haven't tested this in Vista at all but I see no reason it shouldn't work.
Second, it looks like some basic libraries are not functioning - vars, base, prompt, those are really basic ones that should work fine with the default installation of activeperl.
third, I notice your paths are c:/Perl/Perl/lib/...etc. There should only be one /perl/ in there so it should be c:/perl/lib/...etc.
SO, I would recommend fully uninstalling Perl using Control Panel > Add Remove Programs and reinstalling, making sure that the full install path is simply c:\Perl. Hopefully that'll get you one step closer!
minsc_tdp
08-03-07, 11:31 PM
the hear.py window opens only for less than a second and immediately closes again. Nothing happens further on
EDIT: Ok, I made that window run entering "hear.py" instead of "sh4speech.bat". So that window appears with the sentence "listening for phrases from voice_commands.csv", and commands like "map" or "dive" appear there if I speek into the microphone. So I started SH4 parallel to that window and gave several commands, but nothing happened. I went back to desktop and the window showed up with all the commands I gave while Sh ran. What do I do wrong!?!?!?
Any ideas?
Usually just running this stuff from a command prompt instead of double-clicking the BAT will help a lot. Or just edit sh4speech.bat and add a pause to the end of the file.
sh4speech.bat just runs go.pl, which tries to invoke the popup of hear.py. Sounds like the invocation of that failed, but you got hear.py to run on your own, which is just as good. If it said "Listening for voice commands..." then hear.py is working fine, and the question is, is go.pl running? Sounds like no, and probably since it failed, it brought down hear.py with it. It shouldn't but I suppose if it crashed quickly enough it could.
Question is, why isn't go.pl running? Open a command prompt, go do the command "cd \sh4speech" and then type "perl go.pl" (without all the quotes of course.) You'll probably see an error, paste that here and we can make some progress.
It's hard for me to get on the internet here, but when I return I'll write a nice test script that probes all of the various things, like a troubleshooter, which should help make all this easier.
Fraggulus
08-04-07, 12:47 PM
First, I haven't tested this in Vista at all but I see no reason it shouldn't work.
Second, [..]
Hi minsc_tdp,
thanks for your answer.
Instead of using the zip-files from your download-link (btw.: it seems the link isn't working any longer..) I downloaded the msi installation package of ActivePerl (http://www.activestate.com/store/download_file.aspx?binGUID=e5c71329-b7a6-4563-8199-e1483f751c4f) and perl is working.
Now I got a similar problem like moselgott. The window of hear.py is closing after a second with following error message:
Traceback (most recent call last):
File "hear.py", line 103, in <module>
speechReco = SpeechRecognition(wordsToAdd)
File "hear.py", line 33, in __init__
self.context = self.listener.CreateRecoContext()
File "C:\Users\User\AppData\Local\Temp\gen_py\2.5\C866CA 3A-32F7-11D2-9602-00C0
4F8EE628x0x5x3.py", line 2638, in CreateRecoContext
ret = self._oleobj_.InvokeTypes(10, LCID, 1, (9, 0), (),)
pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, None, None, None, 0, -2147467259), None)
But I think this error is based on the Win Vista and maybe the installed German language of Vista.
Possibly some other users successfully tested sh4speech on Vista??
moselgott
08-04-07, 02:44 PM
Hey you Guys, thanks for your help!
I managed to figure out the problem, or better to say I solved it without knowing what it was :dead:
Anyway, I removed everything and reinstalled each single programme, and voilā, everything works as it should now!
I was so amazed when I became aware about the possibilities, so I send you a bigger than big THANK YOU, PERFECTLY DONE!!!!!!!!!!!!
Iīm just wondering what I have to do if I want to use this for IL-2...
minsc_tdp
08-04-07, 07:38 PM
Moselgott - There is absolutely nothing in the code that is specific to SH4. The only thing that makes it work in that game is the CSV files defining all of the commands. You could easily modify those files and make it work with any game. When it presses the keys, it just sends it to the keyboard so theoretically any game should respond to them. Go nuts!
minsc_tdp
08-04-07, 08:00 PM
Fraggulus - the only thing I could possibly recommend there is to make sure to install Microsoft SAPI 5.1 SDK for Windows Vista, if such a thing exists. I know that Vista includes a new version of the speech engine, version 6.0+, and it's possible that hear.py is trying to hook into 5.1 which simply isn't there. It might work to just install it, who knows. I have Vista installed at home so I'll try to get it working there when I return. Possibly, some minor changes need to be made to hear.py to get it to just use the newer Vista speech engine instead of being stuck on 5.1.
moselgott
08-06-07, 11:08 AM
Hi minsc_tdp!
Thanks for your answer, I will try that later on for IL-2 and publish it, of course only if you donīt mind!
But so far I canīt stop bombing you with problems, sorry for that:oops:
I added some other speech commands, as for example "battlestation".
I added the refering entries in the key_codes.csv, key_commands.csv and voice_commands.csv. When the speech recognition is activated, following problem appears:
phyton.exe correctly shows
"battlestation 1186415552.0" (I donīt know what this number means though)
but in a way this is not correctly converted. The programme that makes the key being "pushed" shows this:
Battlestation
Pressing key Bā..
Use of uninitialized value in pattern match (m//) at go.pl line 102
Use of uninitialized value in hex at go.pl line 118.
This phenomenon also appears with several other commands, but not with all altough I canīt detect any differences in the way I entered them. Do you know what this can be caused by?
Thanks a lot:rock:
minsc_tdp
08-06-07, 01:25 PM
Thanks for your answer, I will try that later on for IL-2 and publish it, of course only if you donīt mind!
Of course not, I GPL'd the source so just keep that license with it to ensure everything stays open for everyone.
I added some other speech commands, as for example "battlestation".
I added the refering entries in the key_codes.csv, key_commands.csv and voice_commands.csv. When the speech recognition is activated, following problem appears:
phyton.exe correctly shows
"battlestation 1186415552.0" (I donīt know what this number means though)
but in a way this is not correctly converted. The programme that makes the key being "pushed" shows this:
Battlestation
Pressing key Bā..
Use of uninitialized value in pattern match (m//) at go.pl line 102
Use of uninitialized value in hex at go.pl line 118.
Something is wrong in one of the CSV files. Show me all your entries that relate to this command from all three files. I'm pretty sure it's in the key_codes.csv for "B", the key code is probably incorrect or missing. That "Bā" tells me something is wrong there. Try deleting that ā and make sure the virtual key code is entered and correct, and make sure the scan code is 0x00 for now.
I'm thinking of cleaning this whole thing up and condensing it down to two files - one for SH4 commands with associated keys and virtual key codes all in one file, and one for the voice commands. What do you guys think? Are we in too deep with what we have?
minsc_tdp
08-06-07, 02:02 PM
By the way all, I'm back from my vacation and while I have some catching up to do with work, I plan to get on this flank speed this week with some (hopefully) amazing updates. In general I think what it needs most is a proper installer and a troubleshooter script to help detect issues before allowing the scripts to just run and sink. There's a known bug where a timing issue causes the Perl script to be unable to get the voice command that the Python script detected. There's some basic keys that should have already been added to the key_codes.csv and some cleanup there too since the scancodes aren't even being used and probably never will. The mouse support feature will be worked on after all of these other bugs are fixed (kind of like how I actually complained about adding the Colorado to SH4 when there were still so many bugs to work on. Devs tend to lean toward working on "interesting" things rather than necessary things.)
moselgott
08-06-07, 03:11 PM
Hi again!
Iīve found my mistake. In the key_commands my entry for "B" and the other commands that didnīt work looked like this:
81,Key,Battlestation,B.....
and not
81,Key,Battlestation,B,,,,,
such a shallow detail, but so important...nevertheless, if one door shuts, another opes; or the other way round:
A question that is not related to this topic: How can I include a hotkey for "select tube 7 (8,9,10)", because in the commands.cfg of SH4 only there is only an entry for tubes 1-6.
Thanks in advance (and sorry for my continuous asking...)
Moselgott!
EDIT: Ok, I think thereīs another problem. If pushing Ctrl+F1 (my choice for "select Tube 1"), Tube 2 is selected. If pushing Ctrl+F2, Tube 3 is selected until pushing Ctrl+F6, then Tube 7 is sleceted. No chance to select tubes 1,8,9,10 w/o using the mouse or cycling tubes.
Whatīs that?
minsc_tdp
08-06-07, 05:23 PM
I'll have to fix the bug where if there's no comma after the B that it fails. That's a stupid bug and my own fault.
Regarding "select tube x" I haven't looked at anything other than the default keys according to the reference card. I have to focus on defaults so that it works for everyone. I haven't even looked at the CFG file you speak of.
For those extra tubes, it sounds like SH4 does not allow you to map ANY key to open tubes over 6. So in that case you're basically screwed for now since I only support keys. When we get mouse support in maybe I could get that going, but I didn't know there even WERE subs with more than 6 tubes. I guess those are different boats, which introduces a difficult problem: I presume the tube control panel will look different, and in that case, I'll need to define correct mouse coords for every torpedo control panel type and give you a way to indicate which one you're using, since it would be impossible for it to figure that out on it's own. Sounds like a lot of work... [groan]
minsc_tdp
08-06-07, 06:08 PM
Welcome Google searchers. I don't know why it dumps you on Page 3 (must be a good page) so you should probably start at the beginning:
http://www.subsim.com/radioroom/showthread.php?t=119430
EDIT: Ok, I think thereīs another problem. If pushing Ctrl+F1 (my choice for "select Tube 1"), Tube 2 is selected. If pushing Ctrl+F2, Tube 3 is selected until pushing Ctrl+F6, then Tube 7 is sleceted. No chance to select tubes 1,8,9,10 w/o using the mouse or cycling tubes.
Whatīs that?
lolwut?
How about this: With my latest changes you can chain commands together using the & symbol. If you start the game and don't touch any of the tube selection keys and only use voice, we could set it up to open tube 8 by hitting the cycle key 7 times (from 1), toggling that tube, and cycling 3 more times to go back to tube 1. I don't know how fast you can mash these keys into SH4 and have it get them right but it's worth a shot. I already made a fix where you can chain together as many keystrokes as you want but I haven't uploaded it yet.
minsc_tdp
08-06-07, 09:51 PM
"battlestation 1186415552.0" (I donīt know what this number means though)
By the way, that number is just a unique timestamp that is used to check and see if the command read is different from the previous command to ensure that if you say the same thing twice, it acts on the second as well as the first, since hear.py would otherwise only send the command itself to the Perl script (via a text file write) and it wouldn't know if it changed. Just a hack, ignore it.
minsc_tdp
08-06-07, 10:57 PM
Download URL:
v1.1: http://knepfler.com/sh4speech1.1.zip (~ 7 MB)
CHANGES IN THIS RELEASE
-----------------------
1.1 Bugfix release and minor enhancements
Bug Fixes:
Cleaned up extra commas from CSVs and fixed bug where it would fail without them (added a chomp() to each line read)
Lowered $KEY_HOLD (time to hold down keys) from 0.1 seconds to 0.05 seconds
Moved the launch of hear.py into the two BAT files since sometimes the Perl script may not launch it correctly.
Added a check in the perl script on the phrase.tmp file to prevent reading it while it's being written which caused a rare failure
Added a global variable $MULTI_KEY_DELAY to determine wait time between key presses for multi-key sequences and set it to 0.1 second
Updated bad download URLs in readme
New Features and Improvements:
Added command chaining support using & symbol in key_commands.csv. See Raise All Masts at the bottom of that file for an example.
Drastically improved the text output from both windows to make more sense and help a little with debugging and general understanding
Improved the code readability for anyone who might be trying to match up my perl hashes to the CSV files
Switched to Creative Commons license since it's easier to understand
Added several missing keys to key_codes.csv and alphabetized them for readability, so you can try more keys in key_commands.csv without having to bother to figure out the code stuff
Compatibility
No changes were made to the CSVs that would prevent you from using modified ones from v1.0 with this release.
moselgott
08-07-07, 07:27 AM
EDIT: Ok, I think thereīs another problem. If pushing Ctrl+F1 (my choice for "select Tube 1"), Tube 2 is selected. If pushing Ctrl+F2, Tube 3 is selected until pushing Ctrl+F6, then Tube 7 is sleceted. No chance to select tubes 1,8,9,10 w/o using the mouse or cycling tubes.
Whatīs that?
lolwut?
How about this: With my latest changes you can chain commands together using the & symbol. If you start the game and don't touch any of the tube selection keys and only use voice, we could set it up to open tube 8 by hitting the cycle key 7 times (from 1), toggling that tube, and cycling 3 more times to go back to tube 1. I don't know how fast you can mash these keys into SH4 and have it get them right but it's worth a shot. I already made a fix where you can chain together as many keystrokes as you want but I haven't uploaded it yet.
I think a chain system is a valuable addition to that. A good use for it would be "open all tubes" (w&q&w&q&w....), but I think it is not usable for selecting singular tubes, because in order to get from tube 6 to tube 1 you would have to say "select tube 5", so that 5 tubes are cycled to reach tube 1. Did I get that right? If yes, I wouldnīt like, but it is likable for other commands though.
Nontheless I couldnīt solve my problem. Why is tube 2 selected when pushing Ctrl+F1? And why is there no possibility to select tubes 1,8,9,10?
Fraggulus
08-07-07, 10:32 AM
Fraggulus - the only thing I could possibly recommend there is to make sure to install Microsoft SAPI 5.1 SDK for Windows Vista, if such a thing exists. I know that Vista includes a new version of the speech engine, version 6.0+, and it's possible that hear.py is trying to hook into 5.1 which simply isn't there. ..
hi minsc_tdp,
I didn't find any SDK for Vista. Maybe because of the already built-in speech recognition??
minsc_tdp
08-07-07, 01:23 PM
I didn't find any SDK for Vista. Maybe because of the already built-in speech recognition??
Probably. Go to command prompt, cd \sh4speech and run perl go.pl and python hear.py and post the output of those two commands seperately. I still haven't had a chance to try on Vista at home. Oh also just try installing the regular XP SAPI 5.1 SDK into Vista. A lot of XP stuff should work fine in Vista and I don't see why this is different. Ultimately it would probably be nice to use the newer 6.0 speech recognition engine that Vista has, but I tell ya the 5.1 is good enough for this tiny set of commands.
minsc_tdp
08-07-07, 01:26 PM
I think a chain system is a valuable addition to that. A good use for it would be "open all tubes" (w&q&w&q&w....), but I think it is not usable for selecting singular tubes, because in order to get from tube 6 to tube 1 you would have to say "select tube 5", so that 5 tubes are cycled to reach tube 1. Did I get that right? If yes, I wouldnīt like, but it is likable for other commands though.
Nontheless I couldnīt solve my problem. Why is tube 2 selected when pushing Ctrl+F1? And why is there no possibility to select tubes 1,8,9,10?
First, note that there is already an "open all tubes" command that you could set up if I haven't already added it. And since that's a keystroke that would probably be ideal. The chaining thing will not solve singular tube selection on its own. Having thought about this a lot, here's the only way I think we can handle tubes:
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.
minsc_tdp
08-07-07, 11:31 PM
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
minsc_tdp
08-08-07, 12:55 AM
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?
minsc_tdp
08-08-07, 11:33 AM
Thank you for this unbelievebale Mod. Is there a chance for a german version?
I don't speak German very well (I took it in high school for 4 years and was actually pretty good, but that was over 10 years ago and I've forgotten almost all of it.)
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.
moselgott
08-08-07, 02:11 PM
Wouldnīt this require a german sdk version?
Fraggulus
08-08-07, 03:42 PM
Probably. Go to command prompt, cd \sh4speech and run perl go.pl and python hear.py and post the output of those two commands seperately. [...]
Hi minsc_tdp,
the output of the commands is as follows..
1st) perl go.pl:
sh4speech 1.3 by Minsc (Erik Knepfler)
Press CTRL-C when finished.
Initializing...
Cleanup (deleting phrase.tmp)
Caching key_codes.csv
Caching voice_commands.csv
Caching key_commands.csv
Waiting for a phrase to appear in phrase.tmp...
2nd) python hear.py:
Traceback (most recent call last):
File "hear.py", line 113, in <module>
speechReco = SpeechRecognition(wordsToAdd)
File "hear.py", line 35, in __init__
self.context = self.listener.CreateRecoContext()
File "C:\Users\User\AppData\Local\Temp\gen_py\2.5\C866CA 3A-32F7-11D2-9602-00C04F8EE628x0x5x3.py", line 2638, in CreateRecoContext
ret = self._oleobj_.InvokeTypes(10, LCID, 1, (9, 0), (),) pywintypes.com_error: (-2147352567, 'Ausnahmefehler aufgetreten.', (0, None, None, None, 0, -2147467259), None)
minsc_tdp
08-08-07, 04:00 PM
Wouldnīt this require a german sdk version?
Possibly, but I don't know if the full SDK is even really needed. It really just hooks into the speech recognizer which is built into windows. Control Panel > Speech - if that's set up and working, I think the hear.py code should work. The speech control panel has settings to pick a recognizer in a specific language. I hope I don't have to install a german language version of Windows just to figure this out. Maybe after I fix the Vista issues that will clear some of this up.
minsc_tdp
08-08-07, 06:40 PM
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.)
minsc_tdp
08-09-07, 02:12 PM
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:
if ($data eq "ALLCLOSE") {
for my $tube (1..$tubes) {
print "\t\tSetting tube $tube status to CLOSE\n";
$VARS{"tube".$tube."status"} = "CLOSE";
}
$VARS{"current_tube"} = 1; # If tubes are reset/allclosed, game was probably saveloaded or restarted and we're back on tube 1
} else {
minsc_tdp
08-10-07, 02:00 PM
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...
minsc_tdp
08-10-07, 09:13 PM
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)
minsc_tdp
08-11-07, 03:22 AM
v1.38 posted, more minor fixes.
GhengasCon
08-11-07, 03:48 PM
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!!!
minsc_tdp
08-11-07, 06:20 PM
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!!!
The wxPython has been removed since it is not actually required. I forgot to take the install call out of the install.bat but just ignore that.
I think the source of your other problems is that \sh4speech is not the path. You should be able to hit Start > Run > \sh4speech {enter} and it should show you my files. If not it's in the wrong place. I had a problem with the zip folder structure that was fixed in 1.38 so first be sure you have the latest. Open your root folder (c:\ if that is your windows drive) and unzip the ZIP directly to that. It will create a subfolder therefore you will have c:\sh4speech. Make sure there isn't ANOTHER sh4speech folder inside there, you should see the files. After that, try running the install.bat again and you should be good!
minsc_tdp
08-11-07, 06:30 PM
I got it working in Vista!
Fraggulus PM'd me and I switched to Vista and tried a few more things, and suddenly it worked! No code changes were needed. So here's a few things I think I did since the last time I tried that fixed it:
1. Before trying to run hear.py, make sure Vista Speech Recognition is configured and running. Open the Control Panel, search for Speech and go there. Go through all the setup and training. When you're done you should see the vista speech recognition widget at the top of the screen. If you say something, it will recommend you say "start listening" which you must do before it will hear anything. Try "start wordpad" to see if it's working correctly.
2. This part is in the readme: After #1, make sure you run PythonWin Editor, click Tools > Com MakePy Utility. Find the "Microsoft Speech Object Library (5.3)" select it and hit OK.
3. Run hear.py to test things (don't run the regular launch BATs just yet since it will hide any failure in the hear.py output.) Say "test" or "crash dive" and it should recognize it and print it out, and simultaneously you'll see the vista speech widget show your command.
I didn't test it too much: If you can run hear.py and it's recognizing you without having to say "start listening" that's probably better, since it will then focus on recognizing commands from the sh4speech word list rather than both that and the vista command set (such as things like "start wordpad"). But I'm pretty sure you need to say "start listening" or it will ignore everything.
I think the reason it was failing was primarily that A.) I didn't configure everything and make sure the widget was working first, and maybe B.) I ran the Python MakePy thing prior to doing that.
minsc_tdp
08-11-07, 10:04 PM
Major update 1.5 released! See top post and readme. Now has command bar support using mouse clicks! Adds a ton of new voice commands, nearly 400 total now!
mountainmanUK
08-12-07, 04:24 AM
Hi matey!
Thanks for a great programme!!:D I've been messing around with it for a few days now, and it's working pretty well!!
Just one question....
The latest v1.51 download link (on the first page) brings up a "Page Not Found" error!!
Could you check it out please?;)
EDIT: The link points to v1.51.....if you change it to v1.5 it WORKS!!! Gottit now!!
I also found some confusion when using TriggerMaru1.5, as the Commands.cfg used is a lot different. I have (temporarily) deactivated TM from my installation, while I get more used to working by Voice Commands alone!!
Maybe someone could produce a 'definitive' list of TM1.5 Commands, to enable a simple version to be made, which would work with this VC programme?
Thanks a lot for your SUPERB work!!
Dave
GhengasCon
08-12-07, 11:07 AM
I think the source of your other problems is that \sh4speech is not the path. You should be able to hit Start > Run > \sh4speech {enter} and it should show you my files. If not it's in the wrong place. I had a problem with the zip folder structure that was fixed in 1.38 so first be sure you have the latest. Open your root folder (c:\ if that is your windows drive) and unzip the ZIP directly to that. It will create a subfolder therefore you will have c:\sh4speech. Make sure there isn't ANOTHER sh4speech folder inside there, you should see the files. After that, try running the install.bat again and you should be good!
[/QUOTE]
....OK...You were right! I had unzipped the file to the wrong root directory!.. everything seemed to load correctly this time. I first cleaned out everything that had sh4speech( older version) I then installed version 1.38 ( couldn't get the 1.5 link to work for some reason) one problem down but another to go. Whenever i try to run the test mode or the program itself i get this......
C:\sh4speech>cd\sh4speech
C:\sh4speech>REM perl go.pl testmode | python hear.py
C:\sh4speech>python -u hear.py | perl go.pl testmode
Can't locate Win32/GuiTest.pm in @INC (@INC contains: C:/Perl/site/lib C:/Perl/l
ib .) at go.pl line 10.
BEGIN failed--compilation aborted at go.pl line 10.
once again i did run the fixes that you suggested to Panthercules to get the program to run. I get the feeling that i am missing something very simple. I get this same text if i run the test mode or the actual program. Both abort at line 10.
Drowning in my own ignorance...HELP!:dead:
mountainmanUK
08-12-07, 11:34 AM
EDIT: The link points to v1.51.....if you change it to v1.5 it WORKS!!! Gottit now!!
Instead of clicking the incorrect link, copy the shortcut and paste it into your browser address box, then simply change the last bit from "1.51" to read "1.5"...and it will download!;)
minsc_tdp
08-12-07, 03:05 PM
Link fixed.
I don't know why that Win32-GuiTest doesn't install. Take that line from the install.bat
and run it manually and see what it produces. When complete you should have \perl\site\lib\win32\guitest.pm and two files in \perl\site\lib\win32\guitest (guitest.pc and cmd.pm). There might be other things the PPM line does when installing that but if so I'm not sure what.
If all else fails, sometimes you can get away with simply doing:
ppm install Win32-GuiTest
on the command line which will download it (albeit a slightly older version but it should still work.)
minsc_tdp
08-13-07, 01:27 PM
Added commands for new Trigger Maru command bar buttons and called it 1.55
Can the mouse support be used for incremental rudder commands or incremental depth setting? I hope, I hope, I hope! :lol:
minsc_tdp
08-14-07, 10:16 AM
Can the mouse support be used for incremental rudder commands or incremental depth setting? I hope, I hope, I hope! :lol:
The current incarnation of the mouse support for the command bar is very simple: Just a single x/y coordinate (for two resolutions), and at most two clicks.
So, if you want, you could add a few notches of the rudder (5, 10, 15 degrees or whatever increment you want) and add the voice commands for it pretty easily.
There's the slight problem of the fact that the dial has two modes. If you want to add your rudder thing and leave it in one mode all the time, go for it. I figure I'll have to handle this like the tubes, where it starts with a particular assumption (and can return to this assumption if you say "reset" or something) where the assumption is that the dials show the compass, shallow depth, etc whatever the defaults are. And then it would know how to use the extra mode change click by keeping track of what the dials are set to.
If anyone out there knows how to magically determine the current status of the dials (and the mouse cursor) I'd love to know!
Until I get this working well, "heading to view" works really well for precise movements. :)
To get the coordinates, I use "The Gimp" which is a free photoshop-like app. When you open a screenshot, as you move the mouse cursor over it it shows the x/y at the bottom. Just be sure to select a tool that has a good point on it so you're sure you're getting the pixel you think you are (I use the knife tool, it has a nice crosshair.)
Fraggulus
08-14-07, 01:53 PM
I got it working in Vista! Yeah, it really works! Great! Big thanks!! :up:
Now I have to melt my German version of Vista and the English commands.. This isn't really working offhand. :doh:
But I'm pretty sure you need to say "start listening" or it will ignore everything. Yep, speech recognition must be listening, otherwise it ignores all.
F.
Fraggulus
08-14-07, 02:13 PM
Now I have to melt my German version of Vista and the English commands..
Hi minsc_tdp,
atm I'm changing the voice_commands.csv to check how it is possible to translate the commands. For an example, I want to change "4,Bridge,Bridge" to "4,Bridge,Brücke". But it's not recognizing. Instead I have to say "4,Bridge,Brucke". Is there a possibility to get umlauts working?
F.
minsc_tdp
08-14-07, 03:01 PM
Now I have to melt my German version of Vista and the English commands..
Hi minsc_tdp,
atm I'm changing the voice_commands.csv to check how it is possible to translate the commands. For an example, I want to change "4,Bridge,Bridge" to "4,Bridge,Brücke". But it's not recognizing. Instead I have to say "4,Bridge,Brucke". Is there a possibility to get umlauts working?
F.
I would guess that's because the English recognizer is still running. If German is set up properly in Vista, umlauts should be recognized just fine. I wouldn't rely on the English recognizer for words like "brucke", even though it sort-of works, that's not an English word so it wouldn't be optimized for that. It just made a guess based on the phonetics and maybe happened to work, but I wouldn't think it would be very reliable.
In Vista:
Control Panel
Search for "speech" in the upper-right bar
Click Speech Recognition Options
Click Advanced speech options (upper left)
Under Language, what is selected? Should be v8.0 German. If not, and it's not selectable in the list, you may have to install some kind of add-on pack.
According to this page:
http://www.microsoft.com/speech/speech2007/speechdevarticle.mspx
"Windows Vista includes in all editions our latest speech recognition engine, version 8.0. Available in US English , UK English, French, German, Spanish, Japanese, Traditional Chinese and Simplified Chinese. The engine is included with the corresponding Windows Vista language. Users can install multiple languages by purchasing Windows Multilingual User Interface Packs."
So that sounds like it should be included with the language you have installed, if Vista itself is actually German (and not an English vista with some German stuff installed into it), it should already be German. What happens if you start the windows speech recognizer widget from control panel and say "start listening"? What if you say "fangen Sie an zu hören" or however you would say that in German? What if you say "start wordpad" or "anfang Wordpad"? Which works?
If so your German recognizer is working fine, it could be an umlaut/unicode/script problem, but before I dive into it I'd like to hear that the above is working right.
I'm not sure how I can test that without installing German Vista, which I can't do easily (maybe at work... lots of test machines... but I'd rather not.)
Thanks. I still dont know why they abandoned the incremental rudder after SH2. I will have to see if I can get this set up. I suppose as long as I leave the dial in the compass mode I will always have the same base to work from. In fact the only reason I switch dials is to click on the tiny rudder display. :up:
minsc_tdp
08-14-07, 05:19 PM
Well I'm sure some people use the compass more than the rudder, and some use the rudder more. I think it's pointless to try to prefer one or the other, they need equal treatment. Each has its purpose.
Has anyone tried the "reset tubes" thing yet? I'd like feedback on that, since a similar reset command would probably be used to keep the voice system in sync with the status of the dials.
panthercules
08-15-07, 10:16 AM
Wow! Looks like you've been real busy while I've been gone on vacation. Had no Internet access for the last week or so, and just got back to see all this activity. Just D/L'ed the newest version (1.55) and trying to figure out the best way to migrate my customized 1.0 install to this new one. Before I start playing around with the .csv files, I had a basci installation question. I've renamed my old 1.0 sh4speech folder to keep as a backup, and unzipped the new 1.55 sh4speech folder to my c:\ root to replace it. I still have all the other prerequisite applications installed (perl, python, SDK 5.1, etc.) that I was using for version 1.0.
So - here's the question: Do I need to run the "install.bat" again, or should I be able to just start running the program like I did the previous version?
[edit] Also, do I understand the heirarchy of the file structure correctly, such that the voice_commands.csv is really the key/controlling file, in that if I don't want or need a bunch of the new button-bar or TM-related commands I can leave them in the other .csv files and they'll just be ignored if I don't put any triggering voice commands into the voice_commands.csv file that use or refer to them (as long as I don't create any conflicts by what I put into the voice_commands.csv file)? I've already customized my voice_commands.csv file so heavily from version 1.0 that I'm thinking I might be better off just pasting in a few of the cool new things (like the tubes stuff) into my old file rather than start over customizing the new one (but I'm still poking around in the new files checking out all the cool new stuff, so that might change).
minsc_tdp
08-15-07, 01:22 PM
Wow! Looks like you've been real busy while I've been gone on vacation. Welcome back! Where'd you go?
I was using version 1.0. Do I need to run the "install.bat" again, or should I be able to just start running the program like I did the previous version?
It should just run without reinstalling. The install.bat hasn't changed much, other than to help people get it installed who were having trouble. Worst case you could always run install.bat again, it won't hurt anything (including your CSVs) to repeat the install.
Since there have been so many changes, I'd advise you to read the readme all the way through again, I've injected lots of little changes throughout.
Also, do I understand the heirarchy of the file structure correctly, such that the voice_commands.csv is really the key/controlling file, in that if I don't want or need a bunch of the new button-bar or TM-related commands I can leave them in the other .csv files and they'll just be ignored if I don't put any triggering voice commands into the voice_commands.csv file that use or refer to them (as long as I don't create any conflicts by what I put into the voice_commands.csv file)? I've already customized my voice_commands.csv file so heavily from version 1.0 that I'm thinking I might be better off just pasting in a few of the cool new things (like the tubes stuff) into my old file rather than start over customizing the new one (but I'm still poking around in the new files checking out all the cool new stuff, so that might change).
If there's no entry in voice commands with an ID that matches one of the other files, it is essentially ignored. It is still loaded into memory, but we're talking such small amounts here that it doesn't matter.
The upcoming version moves the various types of commands into many different CSV files: Keys, SetVar, Tubes, Commandbar, Dials. They're all basically the same format but split up just to help organization.
It'll be a bit of a pain to merge your changes, so to make it easy, you should go through your changes to the files and make a note of which rows have changed or are new. All columns to the right of the last one I use are ignored so you can add notes like the "Trigger Maru" notes you see I put in. Then you can sort by this column, and it'll group all of your customizations together for easy copypasting.
I'm working pretty hard on the Dials stuff to get precise depth, heading, and speed control in. If I get it working, it should work very well, and be very easy to add definitions to cover other resolutions. I think it will be a few days at best before I get this released, though I'm going to push for tonight.
panthercules
08-15-07, 01:59 PM
Just spent the last week or so sitting on various beaches, riding the waves and looking out to sea comparing the view to what I remembered of the screenshot teasers for leo's LBO mod :|\\
I'm intrigued with all the changes you made to this to incorporate the command bar buttons, but I've already gotten pretty far (using Setkeys) toward assigning keystrokes to most of the button bar commands I wanted to use, so I'm not sure whether I'll need/use those parts of this latest version or not (I'm puzzled how this would work with all the changes that RFB seems to have made with the command bar - how does the program deal with the fact that certain commands are not always present on the bar in the same place or on the same screens? I see you've had to do some special stuff to make this work with the way TM messed with the command bar, so I'm guessing you'd need to do something similar if you wanted to accommodate RFB as well). I think the command bar stuff is probably a really good addition to help make this more "mainstream" for folks who don't want to go to the trouble of messing with SetKeys to assign keys to these commands (or haven't already done so), but for me I'm thinking my key-based approach will probably work fine since I've already done most of that work.
However, the tube selection work you've added seems fantastic - can't wait to try that out. And of course, I'm really looking forward to your getting the incremental depth and course selection mechanism working. And the recognition speed/efficiency improvements and ability to add comments to the .csv files are quite good as well. As I said, it looks like you've been quite busy while I've been gone - maybe I'll have to go on vacation more often :D
minsc_tdp
08-15-07, 02:17 PM
so I'm not sure whether I'll need/use those command bar parts of this latest version or not
Well you'll have to check it and see if I'm supporting anything you haven't mapped to a key yet. Use whatever works for you. I think keypressing is the best method overall since there's no chance of the mousecursor being "invisible" and it yanking your periscope view while reaching for a button. So, you can either choose to spend a bunch of time mapping keys and avoiding the command bar, or just use it as is and get the hang of how the mouse commands works.
with all the changes that RFB seems to have made with the command bar - how does the program deal with the fact that certain commands are not always present on the bar in the same place or on the same screens?
It doesn't deal with this at all. It is set up for SH4 Defaults + Trigger Maru (TM is only additional buttons, not changes.) Each command bar button is defined as an absolute x/y coordinate for each resolution. It has to be right or it'll press a different button - it doesn't know any better. If this RFB thing you speak of moves buttons around, you'll have to update the CSV.
It's really easy to update the mouse coordinates - look at the coordinates already in there - it's the same ones over and over since there's only a few button positions. The Y position is always the same and the difference between each X position is constant, like +60 pixels or so to move to the next button. So if a mod swaps the position of two buttons, then swap the coordinates of those two buttons with each other in the CSV and you're good, and if there's a new button on the right of a bar that never had a button there, it shouldn't be hard to figure out the coordinate without even having to pinpoint it on a screenshot. As I've mentioned, The Gimp is a free photoshop-like program that is perfect for getting the coordinates - you just move the cursor and it updates the x/y coordinates in the status bar at all times.
I'm considering adding real-time file reading support. This way, you could edit CSVs (like from a 2nd laptop PC) while running the game and try out your changes in realtime, without having to restart anything. This would make experimentation and tuning a lot easier.
panthercules
08-15-07, 04:16 PM
I'm considering adding real-time file reading support. This way, you could edit CSVs (like from a 2nd laptop PC) while running the game and try out your changes in realtime, without having to restart anything. This would make experimentation and tuning a lot easier.
Oooh - this does sound useful - is there any reason this wouldn't work to let you just alt-tab out of the game and edit the .csv files on the same PC? It has been kinda slow having to shut down and restart the game and sh4speech, though since a lot of what I was doing required changing the commands.cfg file to map new keys I would have had to do that anyway. Might be different though (and more help) if playing around with mouse positions and stuff for this new version.
minsc_tdp
08-15-07, 04:44 PM
I'm considering [ability to] edit CSVs (like from a 2nd laptop PC) while running the game and try out your changes in realtime, without having to restart anything.
is there any reason this wouldn't work to let you just alt-tab out of the game and edit the .csv files on the same PC?
That would work just fine too. I don't like doing that on my PC though since sometimes the display gets corrupted, resolution mode-switching takes forever on my display, and a laptop would be a very elegant and fast solution - I wouldn't even have to pause the game. Tweak some numbers, hit save, restate the voice command and see what happens. :)
It has been kinda slow having to shut down and restart the game and sh4speech, though since a lot of what I was doing required changing the commands.cfg file to map new keys I would have had to do that anyway. Might be different though (and more help) if playing around with mouse positions and stuff for this new version.
You know, you can just pause the game, alt-tab, stop sh4speech only, change some CSVs, restart sh4speech, and flip back to the game and it will work just fine. sh4speech is not "connected" to the game in any way. It just works the keyboard and mouse pretty much the same way a human does, and if a game happens to be in the foreground, all the better. :)
Snakeeyes
08-15-07, 07:53 PM
Hey Minsc,
I'm new to VAC. How do I install your SHIV profile?
minsc_tdp
08-15-07, 09:58 PM
Hey Minsc, I'm new to VAC. How do I install your SHIV profile?
I'm new to VAC too, since I don't know what VAC means.
What profile? If you're talking about keyboard configuration and command bar setup, this sh4speech is designed for an unmodified SH4 default configuration.
panthercules
08-15-07, 10:55 PM
Well, just running the new version (without using the install.bat since I still had all the version 1.0 ancillary programs already installed) seems to have worked just fine. The single-window, more verbose test mode seemed to work well, though perhaps it would be nice to be able to have the verbose mode be a selectable/switch type thing so you would only get all that extra stuff if you're having issues and want to debug them - it was a bit hard/time consuming to wade through all the extra output just to confirm that the commands were being recognized correctly when I was just trying to do a quick run through of all my commands to make sure they worked.
Haven't had a chance to try this out in game yet, but the tube selection/door opening and closing mechanism worked very well in test mode. One thing that threw me briefly was the lack of any output in test mode in response to the mouse/command bar voice commands I tried - it finally dawned on me that I probably wasn't going to get results in test mode from asking for the fuel, CO2 and battery status since I wasn't in game, but it would have been helpful if there was some sort of output that would at least acknowledge that the command had been recognized even though the output wasn't a key stroke. Small thing - just something to think about.
Also - I noticed that one of the command bar items (sets of commands) was labeled "oxygen" and had associated voice commands about running out of air to breathe - IIRC however, shouldn't that actually be referring to the compressed air level indicator, and not the breathable air levels (which is really a function of the CO2 indicator in an inverse sense)?
minsc_tdp
08-16-07, 03:21 AM
it would be nice to be able to have the verbose mode be a selectable/switch type thing so you would only get all that extra stuff if you're having issues and want to debug them - it was a bit hard/time consuming to wade through all the extra output
True, it's a lot, but I try to indent everything that's not an actual spoken command so they show up on the left. But I probably should add a debug mode/logger or something for all that extra.
One thing that threw me briefly was the lack of any output in test mode in response to the mouse/command bar voice commands I tried - it finally dawned on me that I probably wasn't going to get results in test mode from asking for the fuel, CO2 [...] but it would have been helpful if there was some sort of output
In test mode, you should see it move the mouse, but not click the mouse button. That's the test feedback, I just avoid clicking since you're probably in windows and I don't want to accidentally delete all your porn or upload your credit card number or something. :)
Also - I noticed that one of the command bar items (sets of commands) was labeled "oxygen" and had associated voice commands about running out of air to breathe - IIRC however, shouldn't that actually be referring to the compressed air level indicator, and not the breathable air levels (which is really a function of the CO2 indicator in an inverse sense)?
That was a joke more than anything :) I thought O2 was breathable but you're probably right, CO2 is probably the only thing related to crew breathing and O2 should be renamed to compressed air in all the voice commands.
panthercules
08-16-07, 11:39 AM
In test mode, you should see it move the mouse, but not click the mouse button. That's the test feedback, I just avoid clicking since you're probably in windows and I don't want to accidentally delete all your porn or upload your credit card number or something. :)
LOL - never mind - apparently, somewhere along the way in merging my old version 1.0 .csv files with the new ones, I must have failed to save the version that had the fuel/CO2/battery button bar commands, which explains why I wasn't getting any feedback in test mode. :oops: Added them back in to my voice_commands.csv and it worked like a charm in test mode.
True, it's a lot, but I try to indent everything that's not an actual spoken command so they show up on the left. But I probably should add a debug mode/logger or something for all that extra.
I think the reason the indentation doesn't help as much as it could is that for some reason I can't seem to maximize/resize the command prompt window that the test mode is running in to make it large enough to keep some of the longer text from wrapping around to the left margin again, which clutters the screen a bit during the test mode. Obviously, not worth spending any real time on, since it does seem to be working in any event.
Now to get out to sea to try this out for real - keep up the great work :up:
minsc_tdp
08-16-07, 02:18 PM
I think the reason the indentation doesn't help as much as it could is that for some reason I can't seem to maximize/resize the command prompt window that the test mode is running in to make it large enough to keep some of the longer text from wrapping around to the left margin again, which clutters the screen a bit during the test mode.
Just make a shortcut to the two BAT files, then right-click Properties on them. Then use the Font and Layout tabs to format it better and make the window larger.
minsc_tdp
08-16-07, 02:31 PM
I've made some excellent progress on the dials. There will be precise 360 degree level control over all of the dials, or less in the cases where it makes sense (like the rudder which is 1-38 degrees).
If you look at the dials in terms of geometry, it gets hairy: For some, the clickable dial area is smaller than others within the same dial. The voice command "right" goes two different directions for rudder versus heading (rudder travels left along the circle to go right!) Rudder has "top dead center" at the bottom and the depth dials have "top dead center" at an even weirder location. Some have unusable areas of the dial. Some are not in degrees but in other units, like depth in feet or speed in knots. Not to mention you have to make sure the dial is actually up with the toggle before you try to click on it.
NONETHELESS, I have everything in place to support all of these quirks. And amazingly, it's only a few definitions in the CSVs that have to be added for each resolution to make the dials work. The items are just dial center point x/y coordinate, radius (in pixels), multiplier (heading uses 0, rudder uses 4), the max setting of the dial, how far the start point is rotated from top dead center, and whether it uses reverse direction (like the rudder where right = left.) When you say how far you want it to go, it only needs this data and a few equations to determine the exact pixel, and I've tested it out successfully. Now it's just a matter of getting it in the code and adding the other tracker stuff (like making sure the right dial is visible) and then typing in all the possible voice commands for each degree. So after this, it shouldn't be much of a stretch to add support for the various torpedo dials (range, speed, AOB, gyro, etc!) So this release with the heading/depth/rudder controls will be 1.6 and the torpedo control version will probably be 1.7.
UPDATE:
Check out this preliminary debug output!
heading right ninety degrees voice command detected at +0.00 seconds
heading right ninety degrees (voice_command.csv id = 705)
Type is HEADINGDIAL0, data is 804,673
Dial 705 needs to be off
Dial info: radius=60, multi=1, max=360, rot=0, rev=1
Clicking coordinates 864,673 to set desired angle 90 on dial
Phrase processed. Waiting for a new phrase...
panthercules
08-17-07, 12:01 AM
RL has gotten in the way of my getting out to sea to try this, but it sounds like you're making some real progress with the course and depth stuff - great news :yep:
minsc_tdp
08-17-07, 12:21 AM
1.6 released with full speed, heading, rudder, and depth control, with perfect precision matching the dials (1-24 knots, 1-38 degrees rudder, 0-360 heading, 15-450 feet depth). Over 900 voice commands added to support this feature. Enjoy.
I'm tired so I haven't tested anything but 1024x768 mode so far. 1920x1080 mode is defined but the dial clicking will be off a bit if the coordinates aren't perfect - I had to tune them a bit for 1024x768 but the 1920x1080 ones are still my original figures. Since that's the mode I play in, I'll be tuning that soon. I'm too tired to do any more tonight. I work my butt off for you guys! If only Ubi would release updates this often and with this much information along with it (see the readme to see what I'm talking about!)
minsc_tdp
08-17-07, 03:14 PM
Hot off the presses!
sh4speech 1.6 Voice Command Reference Card *NEW! (http://knepfler.com/sh4speech/sh4speech_refcard.htm)
panthercules
08-17-07, 11:52 PM
Awesome! I just D/L'ed version 1.6 and will be taking it out to sea tomorrow (dying to do it now but it's just too late here). Just had to say that the new reference card is a great thing - I'd done a quick-and-dirty printout of my own from the .csv file but it ran about 4 pages and was not organized or formatted well at all - this one-pager will be perfect for ready reference till it gets to be second nature.
Well Done :up:
Just one question regarding how you managed to get the course and speed commands working - does it depend on using exactly the formulation you have written (e.g., "heading xx degrees", "heading right xx degrees", "make your speed xx knots"), or is it possible for us to modify these slightly (e.g., "make your course xx degrees", "come right xx degrees", "make turns for xx knots")? There's certainly nothing wrong with the way you've got it now, and I think it's amazing that you've gotten this to work, so I don't want to sound like I'm looking a gift horse in the mouth, but I'd love to be able to have alternate ways to say these things too.
This just keeps getting better and better :rock:
minsc_tdp
08-18-07, 12:13 AM
Just one question regarding how you managed to get the course and speed commands working - does it depend on using exactly the formulation you have written (e.g., "heading xx degrees", "heading right xx degrees", "make your speed xx knots"), or is it possible for us to modify these slightly (e.g., "make your course xx degrees", "come right xx degrees", "make turns for xx knots")? There's certainly nothing wrong with the way you've got it now, and I think it's amazing that you've gotten this to work, so I don't want to sound like I'm looking a gift horse in the mouth, but I'd love to be able to have alternate ways to say these things too.
You're free to change them, of course man! Open voice_commands.csv with Excel and edit the third column. You can highlight a block of cells and do a search / replace for "heading right" to "make your course" or whatever you want and it will only replace in the selected cells. Hell, you could copy them all to another block of 360 commands and then you'd have both.
Unlike all the other voice commands, you might notice that these 1.) All have the same ID for a particular type (that maps to the dial ID) and B.) The Name (2nd column) is somewhat special. The Name is generally ignored but in this case I needed to actually put the numbers somewhere and this was as good as any. So just be careful copy and pasting so that you retain all of that.
(Note: These CSVs are just text so you could use Notepad if you must, but you'll just have to watch more closely to ensure you don't change anything you don't mean to.)
Fraggulus
08-18-07, 04:43 PM
..Is there a possibility to get umlauts working? [...]
Under Language, what is selected? Should be v8.0 German.
.What happens if you start the windows speech recognizer widget from control panel ... Which works?
Hi minsc,
yes, it is 8.0 German and it is working with the German commands. English commands are not recognized.
If so your German recognizer is working fine, it could be an umlaut/unicode/script problem, but before I dive into it I'd like to hear that the above is working right.
I'm not sure how I can test that without installing German Vista,
finally I got it working in large part. If I run 'python hear.py' words with umlauts are recognized. I guess I 'just' have to train my speech recognition one or two more times.
But I saw another failure. If I run 'sh4speech.bat' all commands are recognized except those with umlauts. The error message is as follows:
Phrase processed. Waiting for a new phrase...
pythoncom error: Python error invoking COM method.
Traceback (most recent call last):
File "C:\Python25\Lib\site-packages\win32com\server\policy.py", line 285, in _Invoke_
return self._invoke_(dispid, lcid, wFlags, args)
File "C:\Python25\Lib\site-packages\win32com\server\policy.py", line 290, in _invoke_
return S_OK, -1, self._invokeex_(dispid, lcid, wFlags, args, None, None)
File "C:\Python25\Lib\site-packages\win32com\server\policy.py", line 588, in _invokeex_
return func(*args)
File "hear.py", line 94, in OnRecognition
print phrase
<type 'exceptions.UnicodeEncodeError'>: 'ascii' codec can't encode character u'\xe4' in position 1: ordinal not in range(128) The spoken command was 'nächste Einheit' and the used version of sh4speech was 1.51.
F.
Capt. Shark Bait
08-18-07, 06:06 PM
:|\\ got it in jsgme but i gotta leave for work...now:cry:
i'm wondering if the orders are repeated back, ie: "make your depth 225ft." "make my depth 225ft, aye (sir)"
Digital_Trucker
08-18-07, 10:02 PM
I hate being so far behind, but I'm just now getting to getting sh4speech installed and ran into a bit of a problem. I've followed the installation instructions (unless I missed something somewhere) and run into the following error when I attempt to run the app
can't locate Time/HiRes.pm in @INC <@INC contains C:/Perl/lib C:/Perl/site/lib.> at go.pl line 13
Begin failed--compilation aborted at go.pl line 13.
I have active perl and python installed on C: and the sh4speech folder is also on C:
I followed the instructions to run the COM Makepy utility successfully. I tried rerunning the install.bat and received messages stating that Win32-Locale and Win32-API were already installed and got the "everything should be done now" message.
Any suggestions on a resolution would be greatly appreciated.
Thanks, and nice work on the project. :up:
minsc_tdp
08-18-07, 11:56 PM
:|\\ got it in jsgme but i gotta leave for work...now:cry:
i'm wondering if the orders are repeated back, ie: "make your depth 225ft." "make my depth 225ft, aye (sir)"
1. JGSME does nothing with sh4speech - it's a self-standing application that should run from c:\sh4speech. Check the readme for detailed installation info.
2. I make no effort to repeat them back, so you'll only hear them repeated back if those orders would normally be repeated back in game, which many are.
minsc_tdp
08-18-07, 11:59 PM
can't locate Time/HiRes.pm in @INC
Any messages like these mean a Perl module isn't installed. If you used ActiveState Perl it should have included this but, who knows.
Any message like this can generally be resolved by typing this from a command prompt:
ppm install Time-HiRes
Those are case sensitive I believe - so the module name for HiRes.pm in the Time folder (Time/HiRes.pm) will always be called Time-HiRes. Another example, if it says it can't locate some/module/name.pm then you would type ppm install some-module-name
minsc_tdp
08-19-07, 12:07 AM
finally I got it working in large part. If I run 'python hear.py' words with umlauts are recognized. I guess I 'just' have to train my speech recognition one or two more times.
But I saw another failure. (...error details...)
Wait, that detailed error looks like an error in hear.py. But you said when you run python hear.py that they are recognized, so that is a bit confusing. I'm trying to figure out which of the two is failing - hear.py or go.pl.
I ran some quick tests with go.pl and I see that, even if a valid umlaut voice command is forced in (not using hear.py but with my special trick), go.pl does not handle it properly. I'll look into it.
minsc_tdp
08-19-07, 12:10 AM
I just noticed an error message in 1.6:
"my" variable $x masks earlier declaration in same scope at go.pl line 346, <DATA> line 164.
"my" variable $y masks earlier declaration in same scope at go.pl line 346, <DATA> line 164.
I've fixed it (just updated 1.6 without changing the version number) since it was a harmless error that didn't affect anything.
By the way, you can run sh4speech from anywhere now, it doesn't need to be in c:\sh4speech.
panthercules
08-19-07, 12:40 AM
Just noticed something while tweaking up the voice commands for depth and course as mentioned above - all of the course-related commands are relative to current heading (e.g., come right (or left) xx degrees). Is there any chance of making it work so that you could order a course in "absolute" terms, i.e., "make your course 60 degrees"? It seems like there should be some way to do this by formula, if there's any way to know what your current heading is, but maybe there's no way to automatically get this info to your speech program.
Perhaps you could set this via some sort of variable command (like you do with the resetting your tubes thing) - for example, first say "current heading xx degrees", followed by saying "make your course yy degrees". Then the program could compute how many degrees (zz) left or right you needed to go by properly comparing yy to xx, and then trigger the same mouse click command as if you had spoken "come left (or right) zz degrees".
Any chance something like that could work?
panthercules
08-19-07, 01:41 AM
Also just noticed what seems to be an error in the new 1.6 voice_commands.csv file - the setup items for the number of tubes you have on your boat are still numbered 61-64, which throws off errors in test mode. I think these are supposed to have been re-numbered to 200-203, to match up with the numbering in the new variables.csv file.
My personal tweaks on the course commands seem to have gone well, and once I renumbered the tube setup items the tube commands seem to be working well in test mode too. Can't seem to catch up with your version releases to actually get out to sea and try this out in game, but it's all good - keep up the great work :up:
minsc_tdp
08-19-07, 02:11 PM
Fixed the broken tube commands, updated to 1.61 for that. Thanks man!
There's just no way to do absolute headings. For two main reasons: 1. I have no way to know the current course of the ship, 2.) even if I assume it is North on game start with some kind of reset command, it would lose track quickly if you issued a second heading change while the boat is still turning to meet the first.
panthercules
08-19-07, 03:14 PM
Fixed the broken tube commands, updated to 1.61 for that. Thanks man!
There's just no way to do absolute headings. For two main reasons: 1. I have no way to know the current course of the ship, 2.) even if I assume it is North on game start with some kind of reset command, it would lose track quickly if you issued a second heading change while the boat is still turning to meet the first.
I figured that there was probably no way to know from the game what your boat's current heading is - that's why I was thinking maybe as captain/speaker the player could tell your program what their current heading was to set a variable, like we do with the number of tubes we have - i.e., start by saying a command like "current heading 45 degrees", which would set the "current heading" variable at "45". Then follow by saying something like "make your course 120 degrees", which would set the "new course" variable to "120". Then, your program could compute via formula that the new course desired was 75 degrees (120-45) to the right of the current course, and issue the same mouse command that would be issued if you had spoken the command "heading right 75 degrees". Of course, the formula would have to take the 0/360 crossover point into account, so it would know that if "current heading" was 45 and "new course" was 320, it would need to issue the mouse command as if you had said "heading left 85 degrees" (45 plus the difference between 360 and 320), but while I don't know exactly how that formula would work it seems like it would be something fairly simple to program.
Just a thought, but what you have already done with the tubes and the relative course change orders already seems so magical I figured it wouldn't hurt to ask about this too - in any event, this is looking very cool so far :up:
minsc_tdp
08-19-07, 05:32 PM
Yeah I considered the "current heading 45" thing, but again, it would break if you issued a second course change while the boat was still turning. I don't like to implement things unless they're pretty foolproof. Besides, there are bigger fish to fry, such as these for v1.7 (don't hold your breath for these, it's going to be a while):
[first you lock a ship on the scope. then -]
"recognition manual" or "target ID" (TM only I believe)
[you get the ID done so the TDC is updated properly, then -]
"prepare for attack" (brings up various torpedo controls on attack scope)
[then you would do these in any order, but this would be the typical order]
"torpedo contact type [magnetic | contact only]"
"torpedo depth [0-50] feet"
"torpedo speed [low | high]"
"stadimeter" and/or " target distance 1-???? feet"
"[increase | decrease] angle on bow [0 - 360] degrees"
"[increase | decrease] target speed [1-??] knots" or "calculate target speed" (after two readings of course)
"mark" or "save" or "send to TDC" or "update computer" or whatever
"start position keeper" [I](making sure not to enable it twice which would turn it off)
Then you would fire or make further adjustments after cheating by looking at your PK line on the attack map (as I do hehe).
There's only two problems with this whole thing that I know of:
1. AOB dial stops turning if you turn it too far in one direction, but spins indefinitely in the other direction. Could be a problem after a few "increase aob" orders when it hits the wall and doesn't know it. Should be solvable by simply inverting "increase" requests of 5 degrees into 355 degree "decrease" requests, and always spin it that direction.
2. Some of these commands require multiple key presses and clickdrags, and I don't currently have a way to string those together, but it shouldn't be too hard to implement. I just want to implement this properly as a sort of "macro" like feature where people could string together a series of many commands, for example, you could set up a "crazy ivan" that stops the ship, enables silence, and turns of the radio and gramophone, and jumps to the command room just for atmosphere. :)
For example, increasing AOB on a target would involve this macro sequence:
A. Press the attack scope key to ensure we are there (unless you're already there or on attack map)
B. Click all of the TDC pullout buttons to ensure all computer panels are visible
C. Click the AOB button on the TDC
D. Change the AOB with a click/drag
C. Click the red "mark" button automatically (if I decide you shouldn't have to say "mark" after each one)
So there's four things to do. I'll probably extend the "parent" system that the CSVs already support, where A is the parent of B, B is the parent of C, C parent of D, and D childless. I just have to be sure it is not going to screw up when different types of parents are intermixed, which I'm pretty sure it will right now.
Anyway, don't hesitate to put out to sea with 1.6 since 1.7 will be a while. Unlike certain publishers we all know and love, I enjoy sharing what I'm working on long before I start and sharing exactly how I will do it so I can get community feedback.
As an aside, I'm thinking of putting a longer delay on all commands in order to allow you to say "belay that" which would cancel the last order before it is implemented. But this is pretty tricky.
minsc_tdp
08-19-07, 06:32 PM
Just posted 1.62 which increases compatibility with oscillating house fans and pet snakes
Snakeeyes
08-19-07, 06:43 PM
Hey Minsc,
Still having some weird trouble. I start your SHIV speech batch file. I start up SHIV. I speak after making sure the microphone is set. Nothing.
I try to set up by telling the program how many tubes I have but it does not react. It does follow instructions and set up the dials but that's pretty much it.
I ordered to go to the bridge... nothing happens. I minimized the program and the SHIV speech program window indicates that the command was received... just not followed. Ugh.
minsc_tdp
08-19-07, 08:12 PM
Hey Minsc,
Still having some weird trouble. I start your SHIV speech batch file. I start up SHIV. I speak after making sure the microphone is set. Nothing.
I try to set up by telling the program how many tubes I have but it does not react. It does follow instructions and set up the dials but that's pretty much it.
I ordered to go to the bridge... nothing happens. I minimized the program and the SHIV speech program window indicates that the command was received... just not followed. Ugh.
Whoops, I see the problem... give me a few minutes. You might have noticed this in the sh4speech window:
Undefined subroutine &main::KEYEVENTF_EXTENDEDKEY called at go.pl line 470, <STDIN> line 1.
UPDATE: Fix posted. http://knepfler.com/sh4speech/sh4speech1.63.zip This was probably broken from 1.6 through 1.62.
panthercules
08-19-07, 10:57 PM
Geez - just when I thought I might have a little time before the next release to actually play with this at sea, I check back here and there's been TWO releases since I last checked :o
I must say, however, that this hectic pace seems to be taking its toll on your documentation work :nope: I checked the readme for version 1.63 and (1) saw no mention of the "compatibility with oscillating house fans and pet snakes" changes from version 1.62 (I was really looking forward to reading about those, too) ; and (2) noticed the last version mentioned with change log seemed to be 1.3. You really need to be more considerate of us readme file junkies :lol:
[edit] - lol - just saw that I'd opened the "readme.txt" rather than the "readme.htm" - apparently that readme.txt is still in the zip file from version 1.3 - you might want to scrub it out of there in the next release.
On a more serious note, I found this wording in the readme, which I'd seen before but it didn't register on me at the time: "If you dock or otherwise think all of your tube doors are closed again, just say "set all tubes closed" (id=95). Note that this doesn't actually close any tube doors, it just sets the internal status so that they can be opened."
Does this mean that if you forget to close one of your tube doors, you can't use this "close all outer doors" command (id=95) to actually close all the doors, and you need to either (a) make sure you remember to close each door or (b) cycle through each tube individually and close its doors? (There's no visual indicator in game for when the doors are open, is there?)
minsc_tdp
08-19-07, 11:25 PM
Geez - just when I thought I might have a little time before the next release to actually play with this at sea, I check back here and there's been TWO releases since I last checked :o
Don't get tooo worked up over the release pace. If you have customizations just delete my CSV files from the zip, then copy everything else over. Most updates I just update go.pl anyway.
I deleted readme.txt from the zip.
On a more serious note, I found this wording in the readme, which I'd seen before but it didn't register on me at the time: "If you dock or otherwise think all of your tube doors are closed again, just say "set all tubes closed" (id=95). Note that this doesn't actually close any tube doors, it just sets the internal status so that they can be opened."
Does this mean that if you forget to close one of your tube doors, you can't use this "close all outer doors" command (id=95) to actually close all the doors, and you need to either (a) make sure you remember to close each door or (b) cycle through each tube individually and close its doors? (There's no visual indicator in game for when the doors are open, is there?)
You should never have to go tube by tube and close them individually.
It doesn't actually close any doors, it just sets the internal state so that it assumes they're all closed. If you opened the tube with voice, forget to close it, and then restart the game, port, end/start a mission, or restart the game, then you need to use id #95 "reset tubes". That's what it's for.
Here's a good way to remember:
Anytime you see the game "loading" bar in SH4, say:
"setup 6 tubes" [or 4 or 8 or 10]
"reset tubes"
"reset dials"
(you don't have to wait until the game starts but it's probably a good idea.)
And if you think it's hard keeping up with my releases, I haven't played a single mission since I started sh4speech 1.0. When I get free time, I think, "I could play sh4 or I could fix bugs and add new features to sh4speech... hmm..." guess which one I always pick (lucky you!)
But I warn ya, if NVidia ever gets off their asses and fixes overscan/desktop resize on GeForce 8800s, and I can play the game in 1080i mode, you'll never hear from me again. :)
panthercules
08-20-07, 12:59 AM
You should never have to go tube by tube and close them individually.
It doesn't actually close any doors, it just sets the internal state so that it assumes they're all closed. If you opened the tube with voice, forget to close it, and then restart the game, port, end/start a mission, or restart the game, then you need to use id #95 "reset tubes". That's what it's for.
Well, what I had in mind was being in game, opening a tube door getting ready for a shot, and then for some reason not firing it, but wanting to dive later in the same game session. I don't know if the game models taking damage from this, but I assume it would not be a good idea to dive deep with an outer door open, so I was looking for a way to make sure all the tube doors were actually closed. I had planned to use this ID=95 "close all outer doors" type command for this, but it sounds like this doesn't actually close any doors?
If the game doesn't model this damage, then it's a moot point, but if it does I'd like to make sure the doors are really closed before diving - if this command doesn't do it, is there a way to actually close all the doors without doing it manually/individually for each tube?
minsc_tdp
08-20-07, 01:09 AM
is there a way to actually close all the doors without doing it manually/individually for each tube?
Not that I know of, unless there's some hidden key mapping that does close-only that I haven't heard about. Maybe you can try save/load and hope the game is buggy enough to forget which doors are open :)
Strictly speaking, as the Captain, if you order a door open and then dive and kill everyone on board, that's on you, isn't it. :) Had to say it! hehe
It really shouldn't come up in game that often, right? Generally if you open a door you plan on shooting.
But, if you must ensure they're all closed, the quickest way would be to quickly use the cycle/close keys, making sure to closely watch the message window to ensure they're all closed, select tube 1 and say "reset tubes".
panthercules
08-20-07, 11:33 PM
I was just tweaking up my customized version of the handy new reference card, and I noticed another small error in the voice commands .csv file you may want to fix when you do another version - the alternate command for TBT is currently listed as "Torpedo Bearing Transmitter", but TBT actually stands for "Target Bearing Transmitter" - you may want to change/correct it, or maybe just add the right one and leave the wrong one in there anyway, just in case other folks fall into the same error (certainly an easy enough one to make - I read over it a few times myself while tweaking other commands before it dawned on me that it wasn't right).
Keep up the good work :up:
minsc_tdp
08-21-07, 03:37 PM
I'm working on 1.7 and I thought I'd post a status report. 1.7 should be released in the next week or two, with the primary goals being A.) working with any resolution and B.) new voice commands for all the torpedo computer stuff (PK, exploder, torpspeed, gyro, torpdepth, TDC target speed, TDC AOB, stadimeter, and maybe a few others I forgot.)
I do not plan on supporting "increase target range X feet" via the TDC range dial, because that dial is especially weird and I don't see a real need for it. ID'ing the ship and using the stadimeter already does the work for you. The only reason you'd want to increase/decrease the range is if you're using the Attack Map to look at your PK line and cheat a bit (that's how I play) and even a correction only takes a moment and often is not necessary. If my range is too far I usually just increase the gyro angle a bit to compensate.
Resolutions are fixed up where it should support any resolution the game is using. It's using a very simple algorithm, and I'm so confident it will work I've deleted all data from the CSVs that isn't 1024x768 specific, since it now just calculates it from those base values.
Late last night I was successfully increasing and decreasing torpedo depth settings by voice, which is a new type of dial where it has to click and drag. It's not that complicated and works fine.
My nemesis in this game is toggle switches, like the speed/heading/depth dials, and I found a new farkin' toggle to deal with: That little PK Mode / Torp Settings Mode switch looks like if you click the bottom of it, that will go to torp settings, and if you click the top of it, it goes to PK mode, but that's not what it does. Try it. Regardless of where you click on it, it toggles. So, I have to always know the state of that switch so I know whether I have to click it in order to bring up the torp settings panel (which is the only one of those two panels that has anything clickable.)
Some low-level enhancements have been made with the "parent ID" thing so that we can string commands together infinitely, and of different types. So you could have a single voice command that presses a key, clicks a button by mouse, drags a dial a certain number of degrees, all in one shot. It's not a perfect system yet but it's coming along, and it's usable enough for me anyway, to get the core stuff working.
Keep in mind also that BioShock comes out today and I'll be playing that, so this might take more than a week :) Oh also Shells of Fury, if I can get my hands on it!
Snakeeyes
08-21-07, 04:29 PM
Okay... something weird here... I order battlestations and I get the depth under the keel. What's my issue?
minsc_tdp
08-21-07, 05:48 PM
Okay... something weird here... I order battlestations and I get the depth under the keel. What's my issue?
I can't look at it right this second, I'm at work, but first thing when I get home.
Wait, that's really weird, since Battle Stations isn't even remotely close to depth below keel on the command_bar.
1.) Which voice command appears in the command window after you say it?
2.) What resolution are you playing at?
3.) What does the "battle stations" entry look like in command_bar.csv?
Digital_Trucker
08-21-07, 06:13 PM
and are you using any mods that change the command bar?
minsc_tdp
08-21-07, 07:07 PM
and are you using any mods that change the command bar?
LOL yeah I meant to ask that and totally spaced it out. That's the key question really.
Snakeeyes
08-21-07, 07:33 PM
Okay... something weird here... I order battlestations and I get the depth under the keel. What's my issue?
I can't look at it right this second, I'm at work, but first thing when I get home.
Wait, that's really weird, since Battle Stations isn't even remotely close to depth below keel on the command_bar.
1.) Which voice command appears in the command window after you say it?
2.) What resolution are you playing at?
3.) What does the "battle stations" entry look like in command_bar.csv?
Playing Trigger Maru.
1152x864 (I think)
The command bar says what it is supposed to say... battlestations.
minsc_tdp
08-21-07, 09:25 PM
1152x864
That's the problem. Only 1024x768 and 1920x1080 (to an unknown extent) are supported right now. 1024x768 is best, if you change to that it will all work.
My latest fixes make it work with any resolution and that's a top priority for me to finish right now, so this is truly usable by everyone. I'm very close.
If you absolutely must use 1152x864, and want to use sh4speech, make a backup of command_bar.csv and dials.csv, and then delete everything inside them (the file must remain, but empty is OK). You won't be able to control any of these but at least you can use the keyboard functions.
I expect to finish 1.7 within a week or so which will have support for any resolution, plus control over a lot of TDC, torpedo settings, and PK.
minsc_tdp
08-22-07, 02:21 AM
Well BioShock crashes like mad so I went back to working on sh4speech. You might not believe it, but 1.7 is done. And with this version I cannot foresee adding any new major features - everything you can control in the game is now controllable, at any resolution. It is done! Any other updates would be minor from here.
Since this update is so major, I'm calling it a BETA for now.
Changelog is in the ReadMe (http://knepfler.com/sh4speech/readme.htm).
Here's the download link for 1.7 BETA (http://knepfler.com/sh4speech/sh4speech1.7b.zip).
New commands:
"torpedo settings" and "PK status" (both do the same, toggles the mode. Be sure the torp settings mode is up before doing the following:)
" torpedo depth [0-50] feet" [I](relative to current setting)
"exploder contact"
"exploder influence"
"torpedo speed low" or "low speed torpedoes"
"torpedo speed high" or "high speed torpedoes"
"torpedo gyro [right or left] [0-19] degrees" (relative to current setting! So if it's 5 right now, and you want it 5 left, say "left 10 degrees")
"range finder " or "range tool" (sorry, "stadimeter" just won't recognize)
" angle on bow [0-360] degrees" [I](auto-sends to computer)
" target speed [0-40] knots" [I](auto-sends to computer)
"calculate target speed" (auto-sends to computer)
"toggle PK " (clicks once)
"update PK " (clicks twice to update after new readings are sent in)
(you can also use the full phrase "position keeper" for "PK")
I've tested the resolution compatibility testing in two additional resolutions, and it works great, but I certainly haven't tried every single command. If a command doesn't work, don't panic! Let me know. There could be a few where I indicated that the control is just in the wrong quadrant of the screen. I doubt there are any that don't follow the "rules" of where things end up when the res changes.
At this point I'm going to stop doing anymore work on this except for handling reported bugs and maybe working on improving the installer and compiling to EXEs to eliminate having to install Perl/Python. Beyond that, I'm just going to play the hell out of it to really see what needs doing, if anything!
Digital_Trucker
08-22-07, 09:29 AM
Feels good to finish a project and get to play with it, doesn't it? Looking forward to being able to use all the functions at my screen resolution.
Thanks for all the hard work:rock:
minsc_tdp
08-22-07, 06:28 PM
I just realized why there's a minor bug I saw late last night after release. If you use a command that click/drag the speed, torp depth, or torp angle dials more than 180 degrees, it won't go in the correct direction. It takes the shortest route between 0 angle and your requested angle, so right 270 degrees will actually go left 90 degrees, but this may not necessarily be correct due to the way these dials work - even though you end up at the same point, the direction you twist the dial might be important.
The simplest fix for now is to remove any commands that twist it more than 179 degrees. Or maybe I'll just have it drag along a few extra points between the start and finish points to ensure it spins in the right direction. I'll post that fix tonight.
UPDATE: Posted this fix, no version number change. It's pretty cool to see the dials clicked and dragged all the way to the requested position instead of just sorta zooming there instantly. :) I just set up some shots in the training session, pretty cool. I sunk that ship, and never touched the keyboard or mouse except to ID the ship, set the range finder (stadimeter), and move the periscope left and right.
minsc_tdp
08-23-07, 02:51 AM
I just posted some videos at:
http://knepfler.com/sh4speech/videos
The videos show the entire installation process, as well as a demo video at the end of me sinking a sitting duck almost entirely by voice. Control over these functions is brand spanking new and I haven't practiced any of the commands.
So, in that vid, you might notice one or two missed recognitions - angle on bow is especially tricky for some reason, but it's the only one I've seen behave like that. "toggle PK" was just my throat needing to be cleared. Also, when using calculate speed, it didn't auto-send to TDC, but that's already fixed and posted.
UPDATE: Having lowered my Pronunciation Sensitivity a little, I get much better recognition on the Angle on Bow commands, as expected. You have to tune that once in a while, as the ambient conditions change, as well as microphone distance and gain (mine is on a stand on the table) so you want to use the test mode once in a while and make sure it's recognizing this command and a few others well, as well as not doing a false match when you say something nonsensical into the microphone.
UPDATE: Updated 1.7b (no version change) with a minor fix that speeds up the dial twisting action by using larger steps, instead of hitting every degree on the dial between 0 and the requested setting, which could be kind of slow (watch the AOB turn in my video to see what I mean.)
I'm also considering changing the voice commands from "torpedo gyro left 5 degrees" and "increase angle on bow 90 degrees" to simpler phrases, such as "gyro right 5 degrees" or "spread right 5 degrees", and "increase target angle 90 degrees" (since "bow" seems hard for it to recognize for some strange reason.)
I'll probably release 1.7 Final tonight so I hope to get some feedback on all these new changes before then!
panthercules
08-23-07, 11:03 PM
Watched the video - looks pretty cool, even with the occasional glitch. Still haven't gotten out to sea with this to try it out (had my version 1.63 install ready to go, only to see you had already released 1.7 - plus still trying to tweak leo's latest LBO to work with Kriller's update and a few other things - plus, had to spend a couple of days traveling to a neighboring state for a funeral and deal with some other RL issues) - seems like I just can't keep up with all the amazing progress being made by all the modders :o
Anyway, got stuck in traffic on the way home tonight, and started thinking about trying to adapt SH4Speech to use with IL-2 (got tired of waiting for Oleg's BOB to come out, so I picked up the IL-2 1946 expansion a few days ago and thought I'd give it a whirl with my new PC and projector setup). Now that you've got it so that SH4Speech will run from anywhere, I'm assuming that it should be OK and pretty easy to set up multiple instances of SH4Speech - one for SH4 and another one in a different folder for IL-2, for example - is that correct?
Although this may change once I get into it, all I really want to do with it in IL-2 for now is program it to let me speak some radio commands (simple stuff like asking my wingman or other flights to cover me, or asking the tower for clearance to land, etc.) - I hate having to type those and scan the menu trying to figure out how to send those messages, and they seem like a real natural thing to use a speech-recognition program for. IIRC, those require a two-step process like hitting the tab key and then a number key - I assume from what you've said about your macro ability in SH4Speech that it can handle that sort of key combination, right?
I assume that with only needing those few sorts of commands, for the IL-2 install of SH4Speech I can get by with a much-pared down version of the voice_commands.csv and key_commands.csv files, use the same key_codes.csv file and just use a blank/empty copy of the tubes.csv and variables.csv files (IIRC, you said it needs to have those files, even though they're empty, as opposed to just deleting them entirely?), and otherwise just copy everything in the SH4-related instance into the folder for the IL-2-related instance - any reason that sort of approach shouldn't work? I assume that each instance of SH4Speech would be able to use the same instances of perl, python etc that are already installed and being used by my SH4-related instance (not at the same time, of course), so I wouldn't need to have duplicate instances of those things installed - is that correct?
(BTW - my .csv file-related comments above are based on how you had 1.63 structured - I haven't really digested what changes you might have made to those file relationships in 1.7 yet, but I'll be plowing into that in the next couple of days unless RL gets in the way again - still, I'm sure you can see what I'm getting at as far as what parts it seems I would need and what parts it seems I could do without for the IL-2 instance).
panthercules
08-24-07, 12:47 AM
Finally got out to sea, at least momentarily, just to give 1.63 a try before updating to 1.7. Just a couple of observations so far -
(1) this is really cool - setting the depth, speed and course by voice is especially nice.
(2) took me a minute to figure out one glitch-issue though - not being able to give the mouse command orders while looking around is a bit of a drag. I suspect eventually it will become second nature to click out of look-around mouse mode so that the mouse-movement voice commands can work, but it was rather weird for a while there.
(3) this may be an actual problem - the program seems to be having a problem with the command bar commands when the command/button bar is in "unlocked" mode. This appeared when I issued the command for "resume course" and wound up at the attack scope - I finally figured out that SH4Speech was moving the mouse down to where the "resume course" icon/button would normally be when the bar was "locked", but since the bar was "unlocked" it was actually pressing the upper-tier button for attack scope, which had slid down to the bottom row position because the bar was "unlocked". Maybe you need to add in some sort of delay after the mouse moves down there and before it clicks, in order to give the bar time to move back up into the normal position?
(4) another small point/issue - when issuing the mouse-moving commands on the speed/course/depth dials, it leaves the mouse on the dial, which has the effect of leaving the dial in the "enlarged" mode, which takes up more space in the HUD view and looks odd - is there any chance of adding something after the 'click" that would quickly and automatically move the mouse over to a parking location at the edge of the screen or something, just to get it out of the way and let the dials return to their normal, unenlarged state? Just a thought.
So far though, this is really impressive - the recognition worked very well and was lots of fun. Great work :up:
minsc_tdp
08-24-07, 12:59 AM
Your ideas about different instances are valid now. It should run fine.
I just posted 2.0b, which is basically just 1.7b with the files reorganized a lot, as well as the scripts compiled to EXEs. It was a hell of a lot of work to get that done, and should help a lot of people, hence the major version number increase.
The compatibility with previous CSVs still remains of course, there's just some new stuff in dials especially. There are many IDs now that have special triggers in the code, so you can't necessary assume what the behavior will be based on the CSV content except for simple commands. There's a base behavior, but if id == xxx then special things happen for certain ones. So if you copy a command ID and give it a new ID but with all the same info, it could behave differently.
For IL-2, therefore, I would suggest you try not to re-use any existing IDs, or at least just change the ID if the behavior is not what you expect.
I'll look into the unlocked command bar issue when I can. Right now I'm very curious about how 2.0b works for people who have never installed perl/python, only the speech SDK and just try to run it.
panthercules
08-24-07, 12:26 PM
Well, at least I can skip version 1.7 and go straight to 2.0 - maybe that will help me catch up :D
I did note one small thing while reading through your updated first post above about the new version 2.0 - there seems to be a broken link to the .csv file structure document - I keep getting 404 errors when I try to click that link. Not a huge issue since the document is included in the download, but just thought you might want to know about it since some folks will probably try the link in your post as well.
[edit] - another small question - if I currently have version 1.63, with SDK 5.1, perl and python installed as that required, and I want to move to 2.0 -- I plan on just renaming my 1.63 folder to set it aside as backup, and then unzip the 2.0 files into a new c:\SH4Speech folder for now. Now, the question - do I need to remove or uninstall either the perl or python instances so you can get a good idea as to whether 2.0 works well without them, or can I just leave them where they are and 2.0 just won't use them?
minsc_tdp
08-24-07, 01:45 PM
[edit] - another small question - if I currently have version 1.63, with SDK 5.1, perl and python installed as that required, and I want to move to 2.0 -- I plan on just renaming my 1.63 folder to set it aside as backup, and then unzip the 2.0 files into a new c:\SH4Speech folder for now. Now, the question - do I need to remove or uninstall either the perl or python instances so you can get a good idea as to whether 2.0 works well without them, or can I just leave them where they are and 2.0 just won't use them?
That's a good plan. Get your existing folder out of the way. Unzip 2.0 to anywhere. Merge in any customizations from your old CSVs into the new 2.0 CSV files (don't just overwrite them all of course or you'll lose some new controls.) The CSVs haven't changed much - some new stuff in Dials.csv and Voice_commands.csv.
2.0 won't use Perl/Python, you can uninstall them if you like. Though they're both great tools to learn and don't hurt just sitting there, you should keep them around :)
BTW, PantherCules, a special thanks to you - you've caught so many bugs, and quickly, it's like having a personal one-man QA department. That's one man more than Ubi uses for most projects, so we're doing pretty well! heh
Can you believe we've accomplished all this in under 30 days of development?
panthercules
08-24-07, 09:45 PM
Well, you're doing all the heavy lifting - I'm just playing around with this stuff. Wish I had more time (and skill) to really help you.
BTW - While I was tweaking/merging my custom commands into the .csv files, I spotted a few other small things you might want to check. In voice_commands.csv, you've got a few instances where you have included both key commands and mouse commands for the same function (e.g., deploy decoys by key in ID #17, and with mouse in ID # 507, and next unit/previous unit in IDs 45/46 and 576/577, and (maybe) damage control in IDs 55 and 572) - not sure but that doesn't sound like a good idea. Also, I noticed that the same ID # 558 seems to be used for several different commands (e.g., Send range to TDC, Follow Nearest Warship (TM) and Normal Sweep (TM) ) not sure if that's intentional for some reason, but thought maybe not.
Have you noticed any slowdown, increased recognition problems or other issues as you've expanded the command set so radically? As part of my tweaking I'm winding up creating a somewhat slimmer command set - for example, other than from surface to about 70 feet, I don't think I really need to be able to command depth in 1-foot increments (something just seems a little wrong/too precise under the circumstances to hear myself ordering "make your depth 251 feet"), so I'm just doing 5-foot increments below roughly periscope depth - that gives me the chance to add commands to say it two ways (I also like saying "make your depth two five zero") and still pare down to fewer commands overall. Just wondering if there was any discernible upper limit this might eventually hit from a performance standpoint as the number of commands increases.
This is an amazing piece of work - really appreciate your contribution to the community here :up:
minsc_tdp
08-24-07, 10:47 PM
I'll check on all those weird IDs you mention. I haven't noticed any slowdown or bad recs due to the additional commmands. It's really not that many, even though it looks huge, a lot of them are really just the same command said with 360 different minor variations. As long as the gist of that command is sufficiently different from all others, there's no chance of a bad recognition.
The worst I've seen it do is hear "nine" instead of "nineteen" or "ninety" which is a good case for slimming down the set.
But I like the precise control. When you're changing your speed to match a ship, or rotating AOB or changing target speed, you'll want that. Maybe not for depth control but, who knows.
UPDATE: 55 and 572 do different things - one goes to damage station and the other tells the damage control team to get in gear, I'm pretty sure those are totally different.
558 is send range to TDC, but the other two are 558.1 (Follow Warship) and 558.2 (Normal Sweep).
panthercules
08-24-07, 10:59 PM
But I like the precise control. When you're changing your speed to match a ship, or rotating AOB or changing target speed, you'll want that. Maybe not for depth control but, who knows.
Yeah - I like it for speed/AOB as you say, and for course too (since there's no good way yet to order "set course for xx degrees", you need the precision to get to the exact course you want). It just didn't seem quite right to me for depth and rudder (couldn't see myself ordering "right 13 degrees rudder" either - so I just use 5 degree increments there as well) - purely a personal taste thing.
UPDATE: 55 and 572 do different things - one goes to damage station and the other tells the damage control team to get in gear, I'm pretty sure those are totally different.
558 is send range to TDC, but the other two are 558.1 (Follow Warship) and 558.2 (Normal Sweep).
LOL - well, I knew it was getting late and I was getting tired - turns out I was looking at the old and new files tiled vertically next to each other, so I had squeezed down the ID column widths to where I couldn't see the decimal places, so they all looked like 558 to me - sorry for the false alarm :oops:
minsc_tdp
08-24-07, 11:04 PM
btw i just adjusted the torp depth from a max of 30 to 50 (will be part of 2.0 final), so watch out for that on your next merge... sorry for making that so difficult on ya by changing stuff so much. I also deleted kept the decoy command #17 but deleted #507 since keys are preferred
you should get a utility like BeyondCompare which can intelligently show the differences between these files. would be of immense help when you have a lot of customizations
Digital_Trucker
08-25-07, 11:05 AM
I guess I'm the only person with the problem (or everyone else using the compiled version is running at 1024x768), but I can't get it to recognize my resolution. I tried making the change in the batch file and I've even gone so far as to attempt to recompile voice.pl with the resolution change (not having much luck there, gonna try some more today).
Any thoughts on why it wouldn't work by making the change in the batch file?
Anti_Ship_Fella
08-25-07, 11:20 AM
well sounds great but i dont have a microphone:cry:
minsc_tdp
08-25-07, 01:24 PM
I guess I'm the only person with the problem (or everyone else using the compiled version is running at 1024x768), but I can't get it to recognize my resolution. I tried making the change in the batch file and I've even gone so far as to attempt to recompile voice.pl with the resolution change (not having much luck there, gonna try some more today).
Any thoughts on why it wouldn't work by making the change in the batch file?
Whoops, sorry about that DT! That was a minor brain fart on my part in the code. I've updated it and posted it as 2.01.
Digital_Trucker
08-25-07, 01:39 PM
Whoops, sorry about that DT! That was a minor brain fart on my part in the code. I've updated it and posted it as 2.01.
Hey, no problem dude! Thanks for the quick fix. As for the brain farts, my motto has always been "If you don't have an occasional brain fart, then you must not have a brain":rock:
minsc_tdp
08-25-07, 02:00 PM
well sounds great but i dont have a microphone:cry:
You know, I tested this on a laptop the other day that has a built-in mic. That mic sucks SO bad but yet it recognized great with this. You could probably pick up a simple desktop mic for less than $10.
Here you go, a whole bunch for less than $1 (http://www.google.com/products?q=desktop+mic&btnG=Search+Products&scoring=p)
If you want to spend some money, I'm using this monster (http://www.sweetwater.com/store/detail/OM2/)
AVGWarhawk
08-25-07, 04:24 PM
Install.........easy!
Voice recognition...........good!
Voice got confused response............sometimes.
Wife thinks I'm nuts talking to the computer......not uncommon for me to do so who cares?
Does the voice recognition get better over time? Reason I ask, I say bridge and it takes me there and then the binocs come up.
Other than that, a really neat program. Do not touch the keyboard but for very few things. The best part.....YOU FEEL LIKE YOU ARE SKIPPERING THE BOAT!!!! It is really cool. You say a command and you get a response of "Yes sir". Now, just to get it to recognize my command all the time and you got a winner here. :rock:
minsc_tdp
08-25-07, 05:39 PM
get it to recognize my command all the time and you got a winner here. :rock:
The speech recognition out of the box is decent but keep in mind, it knows nothing whatever about you and the idiosyncracies of your voice. It helps a lot to train it, and of course, to enunciate well, but mostly training.
It won't improve over time on it's own, as it has no way to know if it made a mistake.
Read the ReadMe sections on tuning your microphone and training the speech engine. Under Control Panel > Speech, if you go through a 10 minute training session, that greatly improves the recognition quality.
Also, if certain commands are being falsely recognized (like binoculars when you say bridge), sometimes it helps to change the voice commands slightly to make them a little more different. Perhaps "binoculars please" and "go to bridge", for example.
Excalibur Bane
08-25-07, 05:45 PM
Ah, ha! I got you this time! The list is updated before your sig is even updated! Beat THAT! Muhahaha! :rotfl: :arrgh!:
Digital_Trucker
08-25-07, 05:49 PM
Ah, ha! I got you this time! The list is updated before your sig is even updated! Beat THAT! Muhahaha! :rotfl: :arrgh!:
Gonna have to change your nick to "Speedy Gonzales":rock: :rotfl: :rock:
minsc_tdp
08-25-07, 05:56 PM
Ah, ha! I got you this time! The list is updated before your sig is even updated! Beat THAT! Muhahaha! :rotfl: :arrgh!:
LOL
one other thing everyone... in my zeal to keep sh4speech up to date for Trigger Maru, I didn't notice that TM really does change the layout of some of the command bar buttons, so a stock configuration is broken for a few commands now.
I've updated the system with two launch executables now, one for stock and one for TM, with separate sets of CSV files for each (though there's still just one Voice Command function - that won't matter, even though TM has a few extras that won't work in stock mode, no biggie.)
UPDATE: OK it is posted! http://knepfler.com/images/version.gif with two executables, one for stock and one for Trigger Maru (but still requires stock key config in SH4, commands.cfg) Highly recommend everyone upgrade to this, as always just unzip into your current folder.
AVGWarhawk
08-25-07, 07:18 PM
Also, if certain commands are being falsely recognized (like binoculars when you say bridge), sometimes it helps to change the voice commands slightly to make them a little more different. Perhaps "binoculars please" and "go to bridge", for example.
Ok, so I can change a one word like "go to bridge" and this will help? The basic word of "bridge" still needs to be spoken yes? It is quite facinating that this works as well as it does. I hardly touch the keyboard. Also, when I fire up a game do I always need to say how many torpedoes and reset dials?
minsc_tdp
08-25-07, 07:47 PM
Ok, so I can change a one word like "go to bridge" and this will help? The basic word of "bridge" still needs to be spoken yes? It is quite facinating that this works as well as it does. I hardly touch the keyboard. Also, when I fire up a game do I always need to say how many torpedoes and reset dials?
So, here's what I mean. In voice_commands.csv, the third column is the spoken command (the second one is mostly ignored), so instead of:
4,Bridge,Bridge
57.5,Binoculars,Binoculars
You would make those:
4,Bridge,go to bridge
57.5,Binoculars,binoculars please
Then they would be sufficiently different to prevent overlapping recognitions.
Also do the Configure Microphone under Control Panel > Speech. This only takes moments and can help a lot. Make sure when you speak the test phrases that your level meter sits right in the middle of the green area while speaking. If not, adjust your microphone gain/volume levels accordingly. This guarantees the system hears what you're saying at normal volumes - too quiet is hard to recognize, and too loud causes weird distortions at the top-end that sound staticy and hurt recognition.
You do need to say how many tubes once each time upon loading sh4speech (you can do it before the game loads if you want). I suppose I could cache this in a file somewhere so you have to say it less often, but for now yeah you have to say it each time. Read the section in the Readme called STARTING A GAME for details on how this works, and the other two similar commands, and when exactly you need to do it.
I'm glad to see you're getting great results. I've been trying to convince the skeptical that the voice recognition is excellent - Microsoft and various universities have been working on this stuff for many, many years, and we get to reap the benefit of their efforts. I think this sub genre is a perfect application of it, since there's not very many commands (the fewer commands, the better the recognition), and there's not a lot of similarity between them (bridge and binoculars aside). But I think the number of commands is the key thing.
Picture this: If I said I'm going to say one of two words - "bridge" or "torpedoes", you could probably pick which one I was saying from 100 feet away, underwater with my head in a paper bag. The opposite of that, if I was going to pick any word in the english language, conditions would have to be a lot better for you to figure out what I said. The same applies to this system. A lot of speech recognition stuff is used for dictating into MS Word and for that, it's trying to use the entire dictionary, so it screws up a lot.
minsc_tdp
08-26-07, 04:42 AM
Hey all how about this:
"captain on deck!" or
"captain on the bridge" = start recognizing commands
"XO you have the bridge" = ignore commands until you return to deck
Man that's dorky... cool but dorky as all hell. :)
Just posted an update 2.04 which fixes the fuel/battery/o2/co2 buttons when using the command bar in unlocked/autohide mode.
Digital_Trucker
08-26-07, 08:48 AM
Hey all how about this:
"captain on deck!" or
"captain on the bridge" = start recognizing commands
"XO you have the bridge" = ignore commands until you return to deck
I like the idea of a listen/don't listen command (with the facility to change the spoken command). I am one of those unfortunate people with no mute button on my headset and lots of screaming/screeching people running around in the room. It really gets aggravating when I'm setting up a shot with my last fish and my son's girlfriend comes in the room all dramaed up about something and fires my last torpedo at the sun.:rotfl:
panthercules
08-26-07, 09:12 AM
Yep - sounds like another good idea - I'd suggest another couple of command options:
"X O you have the conn" (sounds better than "bridge" when you're submerged)
"X O you are relieved" (for starting listening back up)
BTW - I'm still testing and tweaking, but so far this is looking really good and lots of fun. One question though - have you changed any of these .csv files since version 2.0b?:
voice_commands.csv
key_commands.csv
key_codes.csv
These are the ones I've been playing with in my customization, and I have them merged based on 2.0b - just want to make sure I haven't missed anything in those files in the newer versions (gonna go look for that comparison program you mentioned a while back, but haven't got it yet).
Thanks for all the great (and FAST!) work :up:
minsc_tdp
08-26-07, 12:06 PM
have you changed any of these .csv files since version 2.0b?:
voice_commands.csv
key_commands.csv
key_codes.csv
Here's a comparison report versus 2.0 using the FC command line (which you also have) (sorry I deleted 2.0b) As you can see all I did was add a few commands:
Comparing files voice_commands.csv and VOICE_COMMANDS20B.CSV
***** voice_commands.csv
516,Patrol Course,Set up a patrol course,
516,Patrol Course,search pattern,
517,Time To End Course,Time to end course,
***** VOICE_COMMANDS20B.CSV
516,Patrol Course,Set up a patrol course,
517,Time To End Course,Time to end course,
*****
***** voice_commands.csv
517.5,Range To End Course,Range to course end,Trigger Maru
517.5,Range To End Course,maximum range,Trigger Maru
517.5,Range To End Course,maximum range at current speed,Trigger Maru
524,Recognition Manual,Recognition manual,
***** VOICE_COMMANDS20B.CSV
517.5,Range To End Course,Range to course end,Trigger Maru
524,Recognition Manual,Recognition manual,
*****
***** voice_commands.csv
557,Send Bearing To TDC,send bearing to TDC,
557,Send Bearing To TDC,sonar send bearing to TDC,
558,Send Range To TDC,send range to TDC,
558,Send Range To TDC,sonar send range to TDC,
558.1,Follow Nearest Warship Contact,follow nearest warship contact,Trigger Maru
***** VOICE_COMMANDS20B.CSV
557,Send Bearing To TDC,send bearing to TDC,
558,Send Range To TDC,send range to TDC,
558.1,Follow Nearest Warship Contact,follow nearest warship contact,Trigger Maru
*****
Rockin Robbins
08-26-07, 01:29 PM
Trigger Maru, and possibly other mods, change the commands.cfg file. The commands.cfg file can be restored from the !BACKUP stored by JGSME to fix sh4speech, I don't know if that will have any effect on Trigger Maru or any other mods that have custom commands.cfg files. Of course you could go and change all the key commands in the CSV as well but this is really designed for the default key configuration. Trigger Maru has some additional command bar items that are supported by sh4speech.
That's a deal killer for me. I'm not going to settle for "I don't know if that will have any effect on Trigger Maru" when you already have a different batch file for Trigger Maru. Either this thing is compatible with Trigger Maru or it isn't. Looks like it isn't without some hacking to make it talk to Trigger's commands.cfg file. Ducimus wouldn't have changed it unless there was an advantage or a necessity to it. If you went through the process of making a different installation for Trigger Maru why didn't you do the whole job and make it work properly?
If I go through the csv file and make it actually work with Trigger Maru, will you use it? Trigger Maru is the mountain, you are Mohammed. You must go to the mountain. The mountain will not come to you.:|\\
minsc_tdp
08-26-07, 01:50 PM
If I go through the csv file and make it actually work with Trigger Maru, will you use it?
I should first clarify the "I don't know if it will have a negative effect" comment - I think it's important to note that if you use TM with the stock key config file instead of the TM custom one, TM itself seems to work fine, though those certain changes are missing.
If you make the CSV, I'll absolutely use it! I'll also support/update it as TM changes. If you don't do it, I'll get to it soon. I've been playing TM and like it so I'd also like to know what I'm missing.
I think what initially annoyed me is that 1.) a mod would just change my map and attack scope keys, and 2.) There's no documentation in TM as to what keys are changed, and 3.) SH4 has no option screen for key config, like every other game ever made, ever, and 4.) It's one thing to add a new key with your mod to the stock config, it's another thing entirely to just randomly change stock keys. So, with all that, my first instinct was to roll that back to defaults to get my keys back, extra TM features be damned, so I've been on stock config this whole time so they key thing hasn't been begging for a fix, on my system anyway. I'm still bewildered as to why TM would change the keys to not match the conveniently provided glossy reference card and then not document them.
Please don't read this as a major complaint against TM - it's an awesome mod - but stock was my priority and the work pile was pretty high. I've only worked on this for a month, and it is only within the last few days starting to truly settle down with no major changes, so now we can really get on this, and for any other popular ones (RFB anyone?)
Trigger Maru is the mountain, you are Mohammed. You must go to the mountain. The mountain will not come to you.:|\\
But if you do the CSV for me... isn't that... the mountain coming... nevermind :)
Here's a list of the changes from TM I just typed up:
TM 1.6 Key Command Changes vs. Stock:
Removed Pause with Backsp
Added Time_compr_normal with Backsp
Added Numpad Ins for Go_back_to_prev_cam
Removed F11 from User_free_camera
Added F9 for Conning_tower_camera
Changed Coning_deck_camera from F4 to F5
Changed Periscope_camera from F4 to F3
Removed B for Binocular_camera
Changed Deckgun_camera from F6 to F10
Changed Cycle_flak_cam from F7 to F11
Changed Navigation_2D_map from F3 to F5
Added F6 for Attack_2D_map
Changed Crew_control from F10 to F7
Disabled > for Camera_on_next_unit
Disabled < for Camera_on_prev_unit
Changed Hydrophone from F8 to H
Removed Y from Systems_control
Removed Cam_zoom_in and Cam_zoom_out (but no keys assigned)
Changed Guns_control from T to I
Changed Toggle_captain_panel from F12 to F8
Added R Radar_toggle_on_off
Added , for Snorkel_depth
Added Ctrl+R for Return_to_course
Added Shift+G for Report_time_to_turn
Added G for Report_time_to_course_end
Added Ctrl+G for Report_range_to_course_end
Added Ctrl+W for Report_weather
Changed Fire from Enter to Ctrl+Enter
Changed W from Cycle_torp_tube to Cycle_fore_torp_tube
Added Y for Cycle_aft_torp_tube
Added Ctrl+V for Report_nearest_visual_contact
Added B for Toggle_battle_stations
Added Ctrl+B for Repeat_last_report
Added Ctrl+N for Report_nearest_sound_contact
Added Shift+N for Report_nearest_warship_sound_contact
Added Ctrl+M for Follow_nearest_sound_contact
Added Shift+M for Follow_nearest_warship_sound_contact
Removed F9 from Radar_view_ascope
Uh oh, I'm seeing a problem. W no longer cycles among all tubes, instead limiting to fore tubes, and Y does aft tubes. That's going to throw off all of my tube management related tracking stuff, I'll have to put some special code in for that. But pretty much all the others are no problem, though I don't think Shift is defined in key_codes.csv yet (hint: VK is 0x10, Scancode is 0x00 (not used), see how CTRL and chained ones like CTRL+Insert are set up in key_codes.csv).
If someone wants to provide an updated key_commands.csv (with any necessary key_codes.csv changes) for TM while I'm working on the tube thing, that'd be great!
Rockin Robbins
08-26-07, 02:00 PM
Trigger Maru is the mountain, you are Mohammed. You must go to the mountain. The mountain will not come to you.:|\\
But if you do the CSV for me... isn't that... the mountain coming... nevermind :)
Now you're making me think! :damn: "Honest, I never saw the mountain. It ran right out in front of me."
Ok, I'll have to edit the key_commands.csv, of course, but it also looks to me I'll have to add ctrl-enter to the key_codes.csv as well. Am I on the right track? I'll get to work. If I could do a Shoot configuration, yours is easier than that, so I shouldn't have a problem there. Ingenius work there identifying the shortcomings of present software and overcoming it. I read your very first post on voice command and never dreamed it would lead to this.
Ducimus should get involved in coordination here, except that he like you is overworked. I'll get involved then. <DANGER! DANGER!> This allows you to use ALL THE FUNCTIONS without having to remember the arcane key combinations. Therefore, it opens up the mod so everyone can more fully utilize it.
Let me put on my Schwarzenegger voice: "I'll be baaaack."
Digital_Trucker
08-26-07, 02:04 PM
3.) SH4 has no option screen for key config, like every other game ever made, ever
Don't want to stick my neck out here, but I've seriously been considering tackling this deficiency in a manner similar to Setkeys for SH3. If I can stay coding motivated, maybe I can get it done before football (American style) gets going real well and the new MotoGP game comes out. If not, all bets are off on when it gets done because, between SH4, MotoGP and the NFL, I won't even have time to sleep.
minsc_tdp
08-26-07, 02:34 PM
IMPORTANT! Very occasionally sh4speech will stop recognizing commands and the system will slow down. If you alt-tab out of SH4 you'll notice a process in Task Manager called sapisvr.exe using a ton of memory. I doubt this is my fault, that's the Microsoft piece. Just kill sh4speech, kill that sapisvr.exe process, restart sh4speech and resume your game. This happened after about an hour of play only once so far.
UPDATE: Fixed in 2.2!
minsc_tdp
08-26-07, 02:37 PM
between SH4, MotoGP and the NFL, I won't even have time to sleep.
Welcome to my world. UFC, SH4, sh4Speech, Counter-Strike, BioShock, Lost Planet, Overlord, DiRT, and at least two dozen other games I haven't finished. Hell I broke up with my girlfriend recently due to not having enough time for games and programming projects like sh4speech. Who said men can't commit? :)
Rockin Robbins
08-26-07, 03:42 PM
Hell I broke up with my girlfriend recently due to not having enough time for games and programming projects like sh4speech. Who said men can't commit? :)
Arrrrrr!:arrgh!: Like a bad penny, I return. Let me try pasting this in here. This represents all key changes from stock SH4 to TM 1.6.
Trigger Maru 1.6 Changes from Stock commands.cfg
Name of Command Keys
Pause_game key command deleted
Time_compr_normal Key0=0x08,,"Backsp"
Go_back_to_prev_cam Key0=0x60,,"Numpad Ins"
Free_camera Key0=0x71,c,"F2"
User_free_camera Key0=0x7B,,"F12"
Interior_radio_camera key command deleted
Conning_tower_camera Key0=0x78,,"F9"
Conning_deck_camera Key0=0x73,,"F4"
Periscope_camera Key0=0x72,,"F3"
Binocular_camera key command deleted
Deckgun_camera Key0=0x79,,"F10"
Flakgun_camera key command deleted
A01gun_camera key command deleted
A02gun_camera key command deleted
Cycle_flak_cam Key0=0x7A,,"F11"
Navigation_2D_map Key0=0x74,,"F5"
Attack_2D_map Key0=0x75,,"F6"
Crew_control Key0=0x76,,"F7"
Mission_order key command deleted
Camera_on_next_unit key command deleted
Camera_on_prev_unit key command deleted
Systems_control;Weapons_mng key command deleted
Toggle_hydrophone_view Key0=0x48,,"H"
Toggle_radar_view key command deleted
Systems_control key command deleted
Cam_wheel_zoom key command deleted
Move_forward delete 0x68,R,"" and 0x68,Rc,""
Move_forward_fast delete 0x68,Rs,"" and 0x68,Rcs,""
Move_backward delete 0x62,R,"" and 0x62,Rc,""
Move_backward_fast delete 0x62,Rs,"" and 0x62,Rcs,""
Guns_control Key0=0x49,,"I"
Toggle_captain_panel Key0=0x77,,"F8"
Radar_toggle_on_off Key0=0x52,,"R"
Toggle_snorkel key command deleted
Snorkel_depth Key0=0xBA,C,"Comma"
Return_to_course Key0=0x52,c,"Ctrl+R"
Report_time_to_turn Key0=0x47,s,"Shift+G"
Report_time_to_course_end Key0=0x47,,"G"
Report_range_to_course_end Key0=0x47,c,"Ctrl+G"
Report_weather Key0=0x57,c,"Ctrl+W"
Activate_deckgun key command deleted
Deactivate_gun key command deleted
Close_sel_torpedo_tube key command deleted
Fire_torpedo Key0=0x0D,c,"Ctrl+Enter"
Cycle_torp_tube key command deleted
Cycle_fore_torp_tube Key0=0x57,,"W"
Cycle_aft_torp_tube Key0=0x59,,"Y"
WP_Identify_target Key0=0x49,s,"I"
Report_nearest_visual_contact Key0=0x56,c,"Ctrl+V"
Toggle_battle_stations Key0=0x42,,"B"
Repeat_last_report Key0=0x42,c,"Ctrl+B"
Report_nearest_sound_contac Key0=0x4e,c,"Ctrl+N"
Report_nearest_warship_sound_contact Key0=0x4e,s,"Shift+N"
Follow_nearest_sound_contact Key0=0x4d,c,"Ctrl+M"
Follow_nearest_warship_sound_contact Key0=0x4d,s,"Shift+M"
Radar_view_ascope key command deleted
View_previous_escort_unit key command deleted
View_next_escort_unit key command deleted
That's just in case someone is interested. Now down to doing violence to key_commands.csv and one hack to key_codes.csv. I'm going to add a keyboard shortcut, shift-I for Weapons Officer Identify Target. Then all of Trigger Maru becomes mine, I'll rename it, route it out of China, sell it for half of what Ducimus does and get FILTHY RICH!!!!! MWAHAHAHAHAHAHA! :arrgh!:
This plan can't go wrong! I am a GENIUS!!!!!:know:
mobius22
08-26-07, 06:52 PM
This mod is awesome. Sitting in the chair five feet fom the keyboard and using the Logitech PS2 headphones (they got a long reach) is really cool. Also, it makes me feel like a real captain. "GO DO THIS!!!" "Yes sir, this." "This."
"GO DO THAT!" "Yes sir. That." "That."
I've also modified the Excel sheet to better suit Trigger Marus settup; this way, I don't get the map when I order "BRIDGE!"
minsc_tdp
08-26-07, 08:05 PM
I've also modified the Excel sheet to better suit Trigger Marus setup;
Um... cool. Well as you can see we're in the middle of some more major surgery to properly support Trigger Maru's custom commands.
Digital_Trucker
08-26-07, 08:32 PM
Who said men can't commit? :)
:rotfl: "Yes, committed , that word should describe most of us." he says as he starts to hum the opening bars of "They're coming to take me away, HaHa".
minsc_tdp
08-26-07, 10:04 PM
It is done! 2.1 is posted with FULL Trigger Maru support, including new custom keys and proper tube support! You can now use trigger maru with its customized Commands.cfg file without having to overwrite that with the stock one.
mountainmanUK
08-27-07, 06:58 AM
Well......I finally ran my first ever full voice control SH4 session!!:D
Everything worked great.....even managed to sink a Jap DD by voice alone....IMPRESSIVE! (Pity he was so close at the time that we got rammed and sunk ourselves, but "hey"!)
Serious KUDOS to you for all the work you've put in on this project over the past few weeks......the short timescale only goes to prove your committment! Some days have included 2 or 3 updates!
My earlier problems with keyboard settings (difference between US and UK boards) didn't amount to much...it was more my own stupidity in implimentation! D'Oh!
Just a couple of questions:
Is it possible to get views (eg. Binoculars, TBT) to "pan" right or left by voice?
Any chance of a similar programme for SH3? There are still a LOT of us over at Wolves at War who are just about to start out on a new WW2 Campaign (the 3rd in the WaW series), and pure voice control for SH3 would be absolutely brilliant!
Many thanks for all your efforts....it's certainly appreciated by this British "Seadog"!:D
minsc_tdp
08-27-07, 10:38 AM
Is it possible to get views (eg. Binoculars, TBT) to "pan" right or left by voice?
I thought about this but wanted to focus on things that a real captain would generally do by voice. When the Cap picks up his binoculars, he doesn't have an ensign holding them in front of his eyes, and then he says "pan left.... stop" and another ensign to turn his body. He just moves them with his hands, and so should you. That's my sort of working design philosophy. It could be done but I think it would be a little silly, and the slight lag in response time would probably make it not stop when you wanted it to anyway. The mouse is just so much better for this.
Any chance of a similar programme for SH3? There are still a LOT of us over at Wolves at War who are just about to start out on a new WW2 Campaign (the 3rd in the WaW series), and pure voice control for SH3 would be absolutely brilliant!
It's been discussed earlier in the thread, all the key commands will work with SH3 already without any code changes, you would just have to update the key_commands.csv and voice_commands.csv to taste. The mouse stuff wouldn't work obviously since the controls aren't in the same place. That would be a pretty major effort - not too bad since there's a lot of similarities - but I'm not sure I want to tackle that right now. I need to wrap this up and work on some other things that need my attention, and then maybe I can do that. But a big de-motivator for me is that I do not even have sh3 installed anymore.
mountainmanUK
08-27-07, 11:30 AM
Hi!
Thanks for your response! As quick as usual!!!:D
I can see your point about the Binocs etc. Makes sense!:up:
I may have a play around with the .csv, to see if I can match it up with SH3. The programme itself seems SO much more responsive and "idiot-proof" than Shoot or VAC, so even without SH3 mouse function, it would still make for a more "real" experience!
I've also given you a valid reason for reinstalling SH3 on to your computer!!;)
I will be happy to try out anything you come up with, in the future, for SH3 Voice Control.
Cheers!
Digital_Trucker
08-27-07, 11:35 AM
.... one of those IR control visors that keeps track of which way you are turning your head (can't remember the name of them, old age :D ) and changes your view in the game to match your head movements. With that implemented into the game and using sh4speech, we might never have to touch the keyboard or mouse again!
John Channing
08-27-07, 11:38 AM
I believe you are thinking of TrackIR...
http://www.naturalpoint.com/trackir/
JCC
Digital_Trucker
08-27-07, 11:39 AM
I believe you are thinking of TrackIR...
http://www.naturalpoint.com/trackir/
JCC
yep, that's it!
Delareon
08-27-07, 12:52 PM
oh yeah, what a great Mod, i missed this feature in SH.
I regulary playing DW and missed the voice commands then in SHIII and IV.
Only one thing i want to ask you. Sometimes i get missinterpretations when i talk
to my wife while im playing or i was just to close on the microphon or something like that. So finally the question: Is it possible to configure something like a push to talk button and if, how could i do so?
minsc_tdp
08-27-07, 03:40 PM
Yeah I've been thinking about a "push to talk" option. It would probably avoid most problems. My highly sensitive mic picks up "Pause" when I type or breath heavily, so I changed it to "pause game" and that helped. Not to mention my brother yelling "dive dive dive" every time he walks in to the room and laughing. If you tune the pronunciation sensitivity in the control panel > speech this is rarely an issue though.
I actually have some code already where I can monitor the status of a key. So I could build this in and probably will. Basically you just need the Perl script to monitor a particular key and if it's not down, throw away the recognized voice command. I don't think it would be efficient to actually start and stop the Python recognizer component with this key, as there would be some overhead to launching it and probably wouldn't respond quickly enough.
But isn't this an amusing feature? Especially when you're running on headphones so she can't hear the game?
Wife: Honey, I'll be right back, emergency at the neighbors house, you know how they are.
SH4: Back Emergency, Aye Sir!
You: Full speed ahead!
Wife: It's not that big of a deal, I'm not rushing over there. Her problems are always on the surface.
SH4: Surface the boat, aye sir!
You: Crash dive!
Wife: Don't be melodramatic. I don't think her marriage is heading for a "crash dive" like you're always saying. She just sets a small fire once in a while for attention.
SH4: Firing tube one, aye sir!
You: Dammit. Close tube one.
Wife: Secure from silence! Blow Ballast! Tube 3! Fire! Tube 4! Fire! Knuckle left! Ramming speed!
You: I want a divorce.
Of course, if your wife really loves you, she'd XO your boat lol. You would stand around in a captain's hat and your underwear and relay casually-phrased orders to her, and she would actually speak the correctly enunciated orders into the mic and confirm the setting - after all, the helmsmen generally don't react directly to the captain's order, it's all through the XO right? And it's a bit of an immersion breaker when you ask for one thing and occasionally get another or a bad recognition and have to correct it manually. The wife would shield you from all that, resulting in the perfect sim!
Let me know if any of you find a woman like that. :)
Delareon
08-28-07, 02:07 AM
looooool, ok its not exactly the same when i play with the voice commands.
The last comment from my wife was "first you spend more time with the Computer than with me and now you start talking to him"
For that reason, can u implement an feature where i can command my wife with voice commands? something like "silent" would help very much *g*
minsc_tdp
08-28-07, 10:10 AM
looooool, ok its not exactly the same when i play with the voice commands.
The last comment from my wife was "first you spend more time with the Computer than with me and now you start talking to him"
For that reason, can u implement an feature where i can command my wife with voice commands? something like "silent" would help very much *g*
She calls your computer "him"? That's odd. :) My girlfriend would always say "it" or "that infernal *******ing machine" or "that stupid box" or "your stupid video games".
panthercules
08-28-07, 11:58 AM
Well, my wife doesn't seem to mind it with SH4 so far - though she does still get a little freaked when I start yelling at my computer in German for SH3 :lol:
Although it'd be cool to have playable Japanese subs in SH4, I'm not sure if I could handle learning enough Japanese to make this work for that :D I would like to see what minsc could do to make this work with recognizing Japanese though - I bet he would have version 2.1j released before I get back from work:rotfl:
minsc_tdp
08-28-07, 12:51 PM
Well, my wife doesn't seem to mind it with SH4 so far - though she does still get a little freaked when I start yelling at my computer in German for SH3 :lol:
Although it'd be cool to have playable Japanese subs in SH4, I'm not sure if I could handle learning enough Japanese to make this work for that :D I would like to see what minsc could do to make this work with recognizing Japanese though - I bet he would have version 2.1j released before I get back from work:rotfl:
2.1j posted
kidding
minsc_tdp
08-28-07, 02:17 PM
So there are two issues I'd like to address and I thought I'd think out loud here and get some feedback.
1.) Memory usage out of control/crashing
This appears to be a definite issue affecting everyone without exception. The problem is the MS Speech SDK executable gets out of control after about an hour or so, and uses up a ton of memory, then stops responding which forces an sh4speech restart. I'm going to check a few more things but I don't think I can stop this from happening unless I terminate myself and restart periodically. The main program (voice.exe) doesn't have to restart, just the hear.exe part, so it would keep track of the tube status and all that, and it would restart very quickly and invisibly.
2.) JGSME Support
This is tricky since the idea of JGSME is when a mod is installed, it's active only when you run the game. So I have to link it to that somehow.
So, when sh4speech is activated with JGSME (now don't panic) I would have to rename the game exe to something else, and put my own in its place. When you launch the game with your usual shortcut, you're actually launching my exe, which would load sh4speech and then the game.
Thoughts?
Digital_Trucker
08-28-07, 02:39 PM
1.) Memory usage out of control/crashing
This behavior is experienced by some users of Shoot also. I believe it is definitely a BillySoft problem with the speech recognition engine. I think the only way around that would be to use another speech recognitiion engine.
2.) JGSME Support
This is tricky since the idea of JGSME is when a mod is installed, it's active only when you run the game. So I have to link it to that somehow.
So, when sh4speech is activated with JGSME (now don't panic) I would have to rename the game exe to something else, and put my own in its place. When you launch the game with your usual shortcut, you're actually launching my exe, which would load sh4speech and then the game.
I'm not sure I follow you here. All JSGME does is put files in the game folder. RadioStationManager and GirlInEveryPort are both JSGME installed but run perfectly fine whether the game is running or not. Having your exe also launch the game might be a cool addition since there aren't too many reasons to run the program without the game. Might cause probs though, if you had to restart the prog because of problem number 1.
mountainmanUK
08-28-07, 03:05 PM
With regard to the "memory overload" problem, and the need to restart sh4speech......would it be possible to add something to the programme that would automatically force a restart every 45 mins (for example)? To prevent this happening right in the middle of some major SH4 event, perhaps an automatic "Pause" could first be triggered, to allow a restart of sh4speech?
Pardon me, if I'm suggesting something which is either impossible, or stupid. I am not at all programming-minded, but merely trying to help with a (hopefully) constructive thought!;)
minsc_tdp
08-28-07, 04:03 PM
mountainman, regarding the memory overload, you've got the right idea, that's exactly what I'm proposing. I've just done some experiments and determined that I can do this no problem. When I terminate the hear.exe component, the MS sapi stuff goes away with it, and it can all be restarted almost instantly, and this can all be managed from the main sh4speech program (voice.exe) and happen invisibly. So I'll probably implement this and post tonight.
digitaltrucker, regarding JGSME, I think you misunderstand a bit. I don't think any mods out there are executable. They just replace resource files in the DATA dir. In fact now that I think about it I'm not even sure JGSME will support replacing the game EXE in the root folder, but anyway, I'll figure all this out.
minsc_tdp
08-28-07, 05:04 PM
perhaps an automatic "Pause" could first be triggered, to allow a restart of sh4speech?
Ohh I didn't notice that at first - that's a really good idea... but hopefully the restart will be so fast, this won't be necessary. On my lowly work PC which is a core2 e6400 at 2.13 GHz, it takes a fraction of a second to restart. It's too fast to even measure.
GhengasCon
08-28-07, 07:24 PM
Hello Minsc!!!
First of all, wanted to congratulate you on a very fine and impressive poece of work!...I have been using the program now for a few days and am completly hooked!..It seems soooo much smoother now trying to manually target ships. I have actually been able to score a destroyer or two instead of always trying to evade them!
I to have experienced the lock up after about an hour of play. It hasn't been that big of a bother for me though. I was happy to just be playing at all after all my startup trouble. I hope everyone knows and appreciates all the personal support and patience you have provided for begginers to the modding community like myself....never a smartass answer to whatever ignorance displayed...Thank you.
Hats off to you and I look forward to any updates or new projects you decide to share!!!
Thanks again :up:
GhengasCon
minsc_tdp
08-28-07, 11:32 PM
never a smartass answer to whatever ignorance displayed
That's odd, in real life I'm considered to be an interminable smartass. Maybe I'm just nice on the internet, heh. Which ironically is the opposite of 99% of the rest of the internet masses that turn into total jerks once they're online and anonymous. :)
minsc_tdp
08-29-07, 01:07 AM
Hot Off The Presses:
2.2 http://knepfler.com/sh4speech/sh4speech2.2.zip
New in 2.2:
Push To Talk Mode added and enabled by default (using PrintScreen key)
Long term memory leaks in sapisvr.exe fixed
I chose the PrintScreen key for a good reason. You can change the key or disable it if you want though. See the ChangeLog and new csv files/press_to_talk.csv file for more information.
For my loyal users who actually follow this monstrous thread, a little undocumented bonus is that you can hold the key right at the end of your phrase and it will still recognize it. See, instead of not hearing you at all when the key isn't pressed, it just decides at the last moment whether to throw it away, so you can do:
make your speed 15 [press and hold the key] knots ... [release key, preferably once the command is confirmed]
As long as it's being held down when the command is actually finally heard, it will be processed.
For you customizers, the only existing CSVs that were altered is key_codes.csv, with two new ones added at the top.
panthercules
08-29-07, 11:32 AM
For you customizers, the only existing CSVs that were altered is key_codes.csv, with two new ones added at the top.
THANK YOU for adding this ".csv change log" type comment :up: This would be tremendously helpful to point this out as you pump out each of your new versions. Makes it much easier for those of us with tweaked .csv files to follow the upgrade path and take advantage of all the cool stuff you keep putting in these things.
Keep 'em coming :rock:
Digital_Trucker
08-29-07, 12:54 PM
And thanks so much for the push to talk button. YAY! No more solar bound torpedoes!
Seriously, though, I wish I could get it to recognize the middle mouse button as a key. I tried using the virtual key code for it (0x04), but it doesn't work. Solved the prob by mapping the middle mouse button to a key with my mouse drivers, but sometimes that doesn't always work so well when the game's running.
minsc_tdp
08-29-07, 01:59 PM
And thanks so much for the push to talk button. YAY! No more solar bound torpedoes!
Seriously, though, I wish I could get it to recognize the middle mouse button as a key. I tried using the virtual key code for it (0x04), but it doesn't work. Solved the prob by mapping the middle mouse button to a key with my mouse drivers, but sometimes that doesn't always work so well when the game's running.
Just posted 2.21 which might fix this by looking at the key down state differently.
Also the version number link in my sig will go straight to the zip now. v2.21 (http://knepfler.com/sh4speech/sh4speech2.21.zip)
Digital_Trucker
08-29-07, 03:11 PM
Just posted 2.21 which might fix this by looking at the key down state differently.
Also the version number link in my sig will go straight to the zip now. v2.21 (http://knepfler.com/sh4speech/sh4speech2.21.zip)
Jeez, if I'd had employees as efficient as you are when I was an employer, I could have taken vacations! Thanks:rock:
Edit : Be careful how efficient you are, or we'll start expecting instant upgrades before we even finish posting.
Efficient and accurate. Works like a charm without having to define a keymap with the mouse drivers!
minsc_tdp
08-29-07, 03:48 PM
Edit : Be careful how efficient you are, or we'll start expecting instant upgrades before we even finish posting.
It helps to not have a girlfriend or a life, and extra free time at the office now and again. :)
GhengasCon
08-29-07, 07:42 PM
Hmmmm....No girlfriend....no wife.....no life.....your sounding like a country music song...Hey!!!...You aren't fixn' to kill yourself or something are you? Then we wouldn't be able to get all the cool stuff you make for us... Well, here is some therepy....WE will be your friends! We will continue to reap the fruits of your labor as any good friends would do ..( much like drinking your beer without asking or paying you back)
You can thank us later by making more stuff :yep:
"ding"..oops...therepy time over...time for you to get back to work...
..BTW....now that there is no need for Perl or Python, would it be wise or unwise to delete these from my computer?? They are probably very good tools for someone who knows how to use them or at least would know what exactly they do. ( for me having them is probably much like a 3yr.old in possesion of a slide rule )
Am I right in assuming that by deleting them I would not be hurting anything as far as the sh4speech or any other program is concerned?
GhengasCon
minsc_tdp
08-29-07, 09:03 PM
Yeah you can uninstall Perl/Python completely if you want. I've tested it on systems that have never had them and it worked fine.
Those languages are a lot easier to learn than you might think. Spend 15 minutes looking at the documentation, start at the beginning and try to learn a little. You'd be surprised, you might even find yourself modding my code instead of just my CSV files.
minsc_tdp
08-30-07, 06:13 PM
Wow, 24 hours without a release... must be pretty stable :)
Digital_Trucker
08-30-07, 08:16 PM
But isn't using the word "useless" and the phrase "for no reason" in the same signature doubly redundant?:rotfl: Besides, I like exclamation points!!!!!!!!!!!!!!!!!!!!
Please forgive the extraneous post, but I really need to get rid of that squinty eyed guy with the "deer in the headlights" expression over there under my nick.
minsc_tdp
08-31-07, 01:04 PM
(You don't like your icon? It's better than my guy who looks like he's standing out in the rain waiting for the bus, thinking about shooting his boss when he gets to the office - and it's not even raining) (aww I'm japanese now)
I'm thinking about adding voice ordered salvos, would be done something like this:
"prepare a salvo"
"fore tubes: 5 shots"
"tube one"
"tube three"
"tube four"
"tube five"
"tube six"
"spread angle 2 degrees" (note lack of left/right)
"fire salvo!" or "abort salvo"
The tubes would rapidfire with the following spread angles:
Tube one: 0 degrees
Tube three: 2 degrees left
Tube four: 2 degrees right
Tube five: 4 degrees left
Tube six: 4 degrees right
Due to the multi-command nature of this, I need to add some kind of audible confirmation during the individual steps.
What do y'all think?
Digital_Trucker
08-31-07, 02:21 PM
me likey!
panthercules
08-31-07, 05:15 PM
(You don't like your icon? It's better than my guy who looks like he's standing out in the rain waiting for the bus, thinking about shooting his boss when he gets to the office - and it's not even raining) (aww I'm japanese now)
I'm thinking about adding voice ordered salvos, would be done something like this:
"prepare a salvo"
"fore tubes: 5 shots"
"tube one"
"tube three"
"tube four"
"tube five"
"tube six"
"spread angle 2 degrees" (note lack of left/right)
"fire salvo!" or "abort salvo"
The tubes would rapidfire with the following spread angles:
Tube one: 0 degrees
Tube three: 2 degrees left
Tube four: 2 degrees right
Tube five: 4 degrees left
Tube six: 4 degrees right
Due to the multi-command nature of this, I need to add some kind of audible confirmation during the individual steps.
What do y'all think?
Great idea - looking forward to it :up:
minsc_tdp
09-02-07, 04:20 AM
After fiddling with the game but never playing, waiting around for, what was it, 5 months for patch 1.3, floundering to figure out how to manually target torpedoes, and then getting distracted for another month writing sh4speech, I've finally completed an actual patrol, the first of my career, ever, in SH4. I'm so proud of my boys. *sniff*
http://knepfler.com/images/medal.jpg
Capt. Crunch showed bravery in the face of several unarmed merchant ships which took twice as many torpedoes to sink as a saltier captain's might have. Fortunately, Capt. Crunch had the knowledge and the good sense to liberally use the "load game" feature to keep doing shot after shot until all torpedoes hit. Yes, Capt. Crunch is one of those types of captains. If he's going to go to sea for 2 weeks with only 15 shots or so, they're all going to count.
The first two sinkings were lone merchants, smaller vessels under 2000 tons. A third and fourth were a pair of lone merchants, which was trickier given Capt. Crunch's horrible experience with manual targeting, and having to adjust the second shot for how he's going to react to seeing his buddy in flames a few hundred feet behind him. It only took about 10 tries to get this right and Capt. Crunch learned a lot about the manual targeting and spread angle.
The last sinking was a heavier 8K ton merchant in the middle of a convoy. It was risky since I was low on torpedoes. It took four shots, two of which had to be sent from the aft after spinning around and doing so under the noses of destroyers. Capt. Crunch had the guts to raise his periscope mere feet from the hunting DDs, knowing he could get his shot off since the damaged merchant wasn't moving. Two shots were gone in less than 30 seconds and she finally went down. Capt. Crunch hightailed it out of there faster than Count Chocula after the sun rises. A few depth charges were dropped here and there but they were way off. Capt. Crunch CANNOT be detected (until he crunches on his cereal! But it was silent running and that's not allowed!)
My secret agent (Tony the Tiger) was inserted succesfully to infiltrate Kelloggs, or whatever the hell his mission was, and I limped home with barely any fuel, getting there with 3% fuel remaining.
So, I used the voice the whole time obviously, and must admit, using the attack map to cheat your shots can take quite a bit of the experience away. But I get more annoyed when I miss. But I would find myself repeating "attack map" and "attack scope" to make those constant adjustments. I also found that I preferred to adjust the TDC settings (Stadimeter, AOB, and Target Speed) by hand. Not only does it feel more real, it's a bit quicker for those rapid adjustments. But I used voice for absolutely everything else and it was great. After a while, you get to learn which ones don't require the mouse, and you can multitask - call out one command that you know uses a key while clicking something else with the mouse.
Honestly I don't know how anyone plays the game with manual targeting without using the attack map to cheat. The stadimeter is all over the place with every reading. Speed estimates are hard. Maybe I just suck. :) But auto-solutions are too easy. A nice compromise would be a weapons officer that determines three solutions - a quick one (least accurate), a decent one, and a highly accurate one (takes longer). So you manage keeping the ship undetected and out of trouble while determining how long you can afford to refine the shot. The fact that you can instantly lock and get an instant, perfect solution that immediately tells you how good it is is too easy, but manual targeting is a bit too hard. Yeah, I do just suck. I have to admit the later shots got easier with practice.
Anyway, I feel great that I actually completed a damn patrol after more than 6 months of having this game, and Capt. Crunch's career is well on his way to glory. Silent Hunter 4 is part of this nutritious breakfast.
Digital_Trucker
09-02-07, 09:32 AM
Congratulations Captain Crunch. I'm glad to hear that Tony was inserted in good shape, but you never told us about the adventures of Ensign Fruit Loops. Maybe that's the next tale?
minsc_tdp
09-02-07, 03:28 PM
Congratulations Captain Crunch. I'm glad to hear that Tony was inserted in good shape, but you never told us about the adventures of Ensign Fruit Loops. Maybe that's the next tale?
I'm not sure why you had to bring that up. It's a well known fact that Ensign Fruit Loops is a member of my crew and died in a diesel fuel related accident during sea trials. He will be missed.
Digital_Trucker
09-02-07, 03:30 PM
Sorry, I must have missed the obituary. My condolences.
minsc_tdp
09-05-07, 06:50 PM
So any other voice command problems to report? Been working great for me, seen nothing that needs fixing really. The salvos are still in the "would be nice and I'll do it one day if I'm really bored" category
panthercules
09-05-07, 08:58 PM
Everything working great here - finally got all my personal tweaks done (and my version of your great reference card revised accordingly), and managed to get my 3 start-up commands (tube number and dial/tube resets) chained together into a single verbal command with a really nice camera shift at the end to serve as visual confirmation that it was recognized, so now I'm just waiting for leovampire et al. to release the new LBO/reflections/smoke/everything else visual mod before heading out to sea for some serious patrolling.
Really looking forward to putting this thing through its paces in a serious career soon, now that my "sea trials" with it are pretty much over :D
I've always wanted to try this application out, but the install process was too daunting - until now. It's so easy to install now, I said, "What the heck, go for it." I can't tell you how much fun it is! Makes it really immersive! I say the command, "Periscope depth," and the crew responds, "Yes, sir! Periscope depth!" The crew must've thought I flipped my lid, repeatedly sumberging and surfacing the boat, changing speeds, opening and closing the torpedo tube doors, stopping, going... They were probably asking the doc to relieve me of my duties. ;)
Thanks for the wonderful mod!!!
Bill
minsc_tdp
09-07-07, 04:27 PM
I've always wanted to try this application out, but the install process was too daunting - until now. It's so easy to install now, I said, "What the heck, go for it." I can't tell you how much fun it is! Makes it really immersive! I say the command, "Periscope depth," and the crew responds, "Yes, sir! Periscope depth!" The crew must've thought I flipped my lid, repeatedly sumberging and surfacing the boat, changing speeds, opening and closing the torpedo tube doors, stopping, going... They were probably asking the doc to relieve me of my duties. ;)
Thanks for the wonderful mod!!!
Bill
I love to see posts like this, makes me feel like the extra effort to compile those EXEs and kill the install procedure really helped.
panthercules
09-07-07, 10:37 PM
I've discovered one major problem with my SH4Speech 2.21 install - despite having added this command and tweaked my .csv files to the max, and checking syntax, ID#s, etc. out the wazoo, I keep shouting out the command "LEO/KRILLER - RELEASE REFLECTIONS ON THE WATER", "LEO/KRILLER - RELEASE REFLECTIONS ON THE WATER", over and over again but the program doesn't seem to recognize the command, and nothing happens :damn:
Please see if you can fix this problem in your next update :yep:
jaketoox
09-08-07, 01:59 AM
I've discovered one major problem with my SH4Speech 2.21 install - despite having added this command and tweaked my .csv files to the max, and checking syntax, ID#s, etc. out the wazoo, I keep shouting out the command "LEO/KRILLER - RELEASE REFLECTIONS ON THE WATER", "LEO/KRILLER - RELEASE REFLECTIONS ON THE WATER", over and over again but the program doesn't seem to recognize the command, and nothing happens :damn:
Please see if you can fix this problem in your next update :yep:
..have you checked out where your microphone is manufactured......if id reads "made in china"....it is possible that "youl miclophone will not lecognize youl command because it's containing too many l:s lepeatedly".....:yep:...only known plopable fix is leplacing l:s with l:s, but they say it will wolk only in 50 plocent of cases...:know:
Jake
I hope this isn't considered hijacking this thread, but I just wanted to let the people using this mod know that I am working on the following change to the voice_commands.csv file:
All commands contianing numbers (heading, depth, etc.), will be called out as individual numbers instead as a complete number. For instance, "heading left one hundred fifteen degrees" will instead be called out as "heading left one one five degrees."
In addition, all references to the number "nine" will instead be referred to as "niner." I've noticed that the Microsoft's speech interpreter confused numbers like "fifteen" and "fifty" very often (as in real life!). Also, "niner" is being introduced as a way to distinguish "five" from "nine," which, even though MickeySoft's interpreter never made a mistake, I thought it might add to the immersion factor. I just thought of something. I don't know if "niner" would interpret to other languages, so you can just do a search for "niner" and replace it with "nine." Sorry about that.
If anyone's interested, it will probably be done in a few days.
My hat's off to minsc_tdp (http://www.subsim.com/radioroom/member.php?u=230109) for making the mod in the first place, and for making it so accessible to fellow modders!
Bill
panthercules
09-08-07, 01:17 PM
@billko - good idea - I did this a while back in my install for the depth readings, (though only for every 5-foot increment), and it does make it sound better. After watching some old WWII sub movies again, I decided not to do it with my rudder commands (though I did change them to a format like "right 10 degrees rudder", again in 5-degree increments), and since you do need 1-degree precision with the heading commands I decided not to do it with those yet (too much work :lol: ).
If minsc could figure out how to let us order a specific course ("make your course two four zero") instead of having to order relative course (which is still an amazing achievement by minsc - don't get me wrong here), I'd do it with those commands too.
I've got a heavily-tweaked set of .csv files, which depend in part on some changes I've made to the commands.cfg file (I added keys mapped to several additional commands so I could use them with SH4Speech), and from which I have also removed some of minsc's commands that I just don't happen to be using yet, and so they aren't really amenable to being used as a JSGME-ready mod. Therefore, I haven't really tried to set anything up to be posted, but you can find a copy of my .csv files here in case anybody just wants to look at them for ideas about how they might want to tweak their own files:
http://files.filefront.com/Panthers+SH4Speech+csv+fiszip/;8507809;/fileinfo.html
(http://files.filefront.com/Panthers+SH4Speech+csv+)
Minsc has done something really cool here, escpecially making it so easy to customize it to your own tastes - well done Minsc :up:
minsc_tdp
09-08-07, 11:38 PM
"niner"
Send it to me when you're done and I'll put it in the distro as an alternate CSV, I meant to do this at well at some point
"niner"
Send it to me when you're done and I'll put it in the distro as an alternate CSV, I meant to do this at well at some point
Hey, it was a lot easier than I thought it would be. Judicious use of the find/replace and all that was left to manually update were all the entries with "zero" in them. :) I'll get it to you tomorrow.
Thank you *so much* for making your application so easily customized!:rock: :up:
Bill
I'm asking because my computer slows down enough in the periscope view that all the tube cycling commands don't get recognized. In contrast, when I am in map mode where the computer is not breathing hard, the cycling works just fine. I need to slow down the "keystrokes" coming from sh4speech. Thanks!
Bill
minsc_tdp
09-09-07, 03:03 PM
I'm asking because my computer slows down enough in the periscope view that all the tube cycling commands don't get recognized. In contrast, when I am in map mode where the computer is not breathing hard, the cycling works just fine. I need to slow down the "keystrokes" coming from sh4speech. Thanks!
Bill
There's no way right now. How about I add a general multiplier that you can change via the launch BAT file that will speed or slow everything. So the default would be 1 and you would change it to like 1.2 to increase the delays a bit.
I'm asking because my computer slows down enough in the periscope view that all the tube cycling commands don't get recognized. In contrast, when I am in map mode where the computer is not breathing hard, the cycling works just fine. I need to slow down the "keystrokes" coming from sh4speech. Thanks!
Bill
There's no way right now. How about I add a general multiplier that you can change via the launch BAT file that will speed or slow everything. So the default would be 1 and you would change it to like 1.2 to increase the delays a bit.
That would be beautiful, but you don't have to release it until you have a bunch of other stuff, too. I can always cycle them by saying "next tube." :)
Bill
minsc_tdp
09-09-07, 11:39 PM
I can always cycle them by saying "next tube." :)Bill
Careful with that, if it missed a tube switch, say you start at 1 and say "tube 3" and it misses it, then you say "next tube" twice to reach tube three, it will actually think you're on tube 5. Then if you say "open tube 1" it will think it has to go 2 more to go 6,1 and it will actually end up opening tube five (cuz you're on 3 and it goes 3+2). So it's best we fix this. If you find yourself all mixed up of course just say "reset tubes" and click tube 1, and it should be fine from there.
I can always cycle them by saying "next tube." :)Bill
Careful with that, if it missed a tube switch, say you start at 1 and say "tube 3" and it misses it, then you say "next tube" twice to reach tube three, it will actually think you're on tube 5. Then if you say "open tube 1" it will think it has to go 2 more to go 6,1 and it will actually end up opening tube five (cuz you're on 3 and it goes 3+2). So it's best we fix this. If you find yourself all mixed up of course just say "reset tubes" and click tube 1, and it should be fine from there.
I figured that, so I don't rely on it. If the torpedo room didn't "hear" me, I hit the "w" to make sure the command goes through. From the documentation you provided, I figured it was absoultely essential to do this or everything would get out of sync. And, of course, the few times I forgot, I went to "manual override" until I was out of the firefight, then "reset tubes" - after manually setting the tube to tube one, of course.
I hope that the delay thing will fix it. My theory is that when it starts to lag, the program starts loading the keyboard buffer more quickly than SH4 can read it; therefore, some of the "keystrokes" are overlooked. The other theory is that SH4 clears the keyboard buffer right before it reads it, instead of right after it reads it. While that seems to be just semantics, it comes into play when the game slows down significantly because the window of opportunity where the player can input a keyboard stroke and have it be cleared "accidentally on purpose" gets pretty big. A variant of that theory is that the computer slows down so much that the keyboard interrupt isn't serviced until it's too late and the SH4 dumps the keyboard input for the reason above. I dunno, timing gets hairy when the computer is under duress like that. The last theory would explain why, when deep in time compression, the mouse and keyboard become fairly unresponsive, and may be the reason why keyboard strokes are lost to me when the graphices slow the game down.
I hope this has given you some insight on how you might make this super mod accomodate slow rigs like mine. I say it's optional because there's nothing wrong with the mod; it's something wrong (read: slow) about some of the computers it's being run on.
Bill
minsc_tdp
09-10-07, 06:01 PM
Yeah I hear ya on the lag thing. That's why my first thought was to make a general multiplier that slows everything and is configurable. I've learned my lesson with other similar tools like this I have written - don't hardcode the delays. So I am using global variables at the top that are easy to adjust, no delays are hardcoded (though from y'all's perspective, it is, since it's currently not changable. So that'll get fixed.)
minsc_tdp
09-12-07, 12:57 AM
2.22 posted with delay multiplier, see changelog!
minsc_tdp
09-13-07, 09:50 PM
Off topic post: I have a poll/raging argument going on that I need everyone's input on. Link is here.
http://www.subsim.com/radioroom/showthread.php?t=122118
It is right up your guys' alley since it's about the physics of water pressure on an underwater object with chambers and seals, just like a sub.
hi, i've just installev v2.22 of the speech recognition program. I'm running it in Windows Vista. I have to say well done guys I've been looking for something like this ever since I played Sub Command with voice controls.
I have to say, it works perfectly...on my desktop. When I start it up, I get a little console page and a small microphone on my taskbar. All's good. I hold down "print screen" and talk and the order shows up in the console no preoblem, perfect accuracy every time.
HOWEVER, when I start the agme (leaving the console running in the backround) it's very hit and miss. Half the time it ignores me. The strange thing is... if I minimse the game and look at the console, it has recognised every single command perfectly and executed it... but the game hasn't registered!!!! There are also times when its opens internet explorer or dragged icons across my desktop, or something like that.
I am running Trigger Maru 1.6.2 but I didn't think this would be a problem because I am running "sh4speech-trigger maru.bat". It gets the stations right and remembers the Y key for the aft tubes, so im sure its mapped correctly.
Someone please help:cry: I want to give you all a massive pat on the back for this mod but I'd like it to work properly first, lol.
hi, i've just installev v2.22 of the speech recognition program. I'm running it in Windows Vista. I have to say well done guys I've been looking for something like this ever since I played Sub Command with voice controls.
I have to say, it works perfectly...on my desktop. When I start it up, I get a little console page and a small microphone on my taskbar. All's good. I hold down "print screen" and talk and the order shows up in the console no preoblem, perfect accuracy every time.
HOWEVER, when I start the agme (leaving the console running in the backround) it's very hit and miss. Half the time it ignores me. The strange thing is... if I minimse the game and look at the console, it has recognised every single command perfectly and executed it... but the game hasn't registered!!!! There are also times when its opens internet explorer or dragged icons across my desktop, or something like that.
I am running Trigger Maru 1.6.2 but I didn't think this would be a problem because I am running "sh4speech-trigger maru.bat". It gets the stations right and remembers the Y key for the aft tubes, so im sure its mapped correctly.
Someone please help:cry: I want to give you all a massive pat on the back for this mod but I'd like it to work properly first, lol.
Unfortunately, I think that not much can be done at this point because the graphics are slowing the system down enough so that it starts missing keyboard (and mouse) interrupts. A variable was introduced in the latest version to try to slow down keyboard input from the mod to avoid sending keystrokes too quickly in succession, but that's only part of the problem. If you notice the way *you* use the keyboard when looking through the periscope or on the bridge, I bet one thing you do is hold the keys down longer. You hold them down until you see a response from the game. Unfortunately I don't think it would be an easy task to put a watchdog on the thread in the game used for keyboard and mouse input. One place I notice it misses for me is when selecting and opening/closing torpedo tubes while looking through the attack periscope. If you go to a more static screen such as the map or the torpedo management screen, you'll find that it executes flawlessly. I'd say that if you experience any significant frame rate drops in a view, you'll also experience "missed" commands. You just have to accept that your crew is hard of hearing - too many depth charges, I suppose. ;)
Bill
i guess that kinf of makes sense. I edited the delay variable to 1.2 and then to 1.5 but I didn't get much better. one thing i DID notice with a little further testing is that mouse inputs execute flawlessly in all views. It only misses keyboard inputs. But i have to say you're right about missing tube orders in periscope view. that's something to try I guess, going to map (but then, i can't shout "map" becuase it ignores me, lol)
in a way, it's not too bad becuase hitting a key is the easy part compared to clicking around, and its still a really cool mod. I'll test it a bit more.
just as a check, what value do you use on the delay setting?
Digital_Trucker
09-14-07, 07:55 AM
You just have to accept that your crew is hard of hearing - too many depth charges, I suppose. ;)
Bill
And, no, screaming louder won't help, I tried that when I had FPS problems myself:oops:
LOL guys. But seriously, I've found that the delay thing doesn't help me much at all because I have a lower-end computer and I don't think anything short of a major upgrade will help.
When firing torpedoes from the attack persicope view, I find it more useful to say "next tube" bacause it almost always gets the first voice command. If it SH4 *doesn't* recognize the "next tube" command, but you verify that it was sent, *manually* cycle to the next tube so that the speech application doesn't lose synch with the game. Before getting in a firefight, if I need to do something like open tube doors, I go to the torpedo management screen and execute the commands there. And yes, I'm that lazy.
Bill
Digital_Trucker
09-14-07, 11:23 AM
I've run into a little problem that I'm not sure whether it's just me or not. Is anyone having any difficulties with the rudder and bearing commands? I have just recently started using these commands and ran into a strange occurrence. When I give any bearing or rudder command (i.e. rudder port/starboard X degrees) the command is executed perfectly except that it always goes to the starboard side. I have checked in the command window for sh4speech and it is correctly recognizing the orders, just executing all to one side. I'm running 1280x1024 and have set that up in the batch file. Has anyone seen this behavior and/or know what causes it?
minsc_tdp
09-14-07, 06:58 PM
Regarding the missed keys, try setting a ridiculously high delay via the BAT file, like 5. If that solves it, it's a performance issue with your PC.
It could be a problem with the keycodes if you are using a foreign version of windows or have some international regional settings in the control panel. If that's the case, the hits will always hit and the misses will always miss, since it has to do with some codes being valid by chance and others not. But I'd guess it's a delay problem.
DigitalTrucker, I've never seen what you're talking about. That's a really bizarre problem. Check your CSVs to be sure they haven't been altered - there's information about the heading dial rotation and size and if they're messed up it might explain this. Try re-extracting those from the original zip. It's a long shot I know. Also please explain exactly what you see with the mouse when you do "heading right ninety degrees" and "heading left ninety degrees". When I say exactly, I mean for every mouse movement/click in the sequence, tell me exactly where it is landing for each command. It could be a resolution issue.. have you triple checked to ensure you really are in 1280x1024 mode? Have you edited that in both BATs? Does the resolution show up in the sh4speech debug window on startup?
I'm going on a few days camping trip to Mt. Whitney this weekend, back next week. Good luck until then :)
Digital_Trucker
09-14-07, 08:40 PM
:oops: Shoulda looked a little closer at the original files. Evidently, when I used my spreadsheet program (OpenOffice) to edit the file once upon a time, it decided that the text fields in the CSV file needed quotation marks (") around them. I never noticed the change because all the other commands worked fine. The problem evidently only arises with those commands that can have a negative sign (hyphen,-) in front of their entries to designate direction. Everything should be hunky-dory after I strip out the quotes:damn:
Don't know if it's even worth thinking about, but if this could be a common problem with spreadsheet programs, maybe a mention in the readme would help some other poor slob (i.e. me) not make the same mistake.
As for the answers to all your above questions: the same exact thing,yes,no,yes.
Enjoy your camping trip (and if you see this afterwards, I hope you enjoyed it):rock:
:oops: Shoulda looked a little closer at the original files. Evidently, when I used my spreadsheet program (OpenOffice) to edit the file once upon a time, it decided that the text fields in the CSV file needed quotation marks (") around them. I never noticed the change because all the other commands worked fine. The problem evidently only arises with those commands that can have a negative sign (hyphen,-) in front of their entries to designate direction. Everything should be hunky-dory after I strip out the quotes:damn:
Don't know if it's even worth thinking about, but if this could be a common problem with spreadsheet programs, maybe a mention in the readme would help some other poor slob (i.e. me) not make the same mistake.
As for the answers to all your above questions: the same exact thing,yes,no,yes.
Enjoy your camping trip (and if you see this afterwards, I hope you enjoyed it):rock:
Digital Trucker:
Apparently, OpenOffice is treating the negative number as text because, strictly speaking, the "minus" sign isn't a numeric character) and putting it in quotation marks. Putting text in quotes is standard CSV convention because the text itself may contain a comma, which would mess up the way the file was decoded. The quotation marks tell the CSV decoder to treat everything in between as one field. As for the reason *why* OpenOffice is treating a negative number as a string, well... I guess you gotta ask the authors of the project about that one...
Bill
NefariousKoel
09-14-07, 09:17 PM
Those comma-delimited bastards!
minsc_tdp
09-14-07, 10:59 PM
Oh, that doesn't surprise me in the least. The behavior of Excel with the negatives is bizarre as all hell. OpenOffice is probably doing it technically right!
The problem is that I wanted Excel to treat those fields as numeric so that I could do a series fill to easily type in the extra 360 numbers, to avoid keying them in by hand. So the fields just said 1 or -1. Then, I used the Format Cells feature to apply the following custom label:
"Heading" 0
I expected that to turn 1 into Heading 1 and -1 into Heading -1. But oh no. Excel puts the - symbol before the word Heading so you get -Heading 1! I was shocked and annoyed but due to laziness and wanting to keep those as numeric fields, I coded the script to recognize the - at the very start of the field and then pluck out the number and invert it. For positive ones (where it doesn't detect the - symbol) it just plucks the number and leaves it alone.
The quotes made it not detect the - symbol, and so it treated it as a positive number, which explains why all commands were starboard, and also explains why the voice command showed up correctly in the debug window (though if you were to look closer, you would have seen "heading right 90" with "Desired angle: 90 degrees" and on "heading left 90" you would have also seen that instead of -90 which is correct. I don't blame you since I'm currently spewing quite a bit of debug output there.
I guess another aspect of the problem was the default behavior of Excel is to not quote wrap CSV output while OpenOffice does. It's not treating a negative number as a string - it really is a string - the string is "- Heading 90". So it's really correct to put quotes, and I'm relying on the fact that Excel doesn't.
In the future just post the command window debug output I can probably spot the problem in the midst of all that junk better than y'all and get to the root of the problem right away. I really need to clean that stuff up the and boil it down to the essentials (balancing that is always hard though - too little and you risk not showing the critical info you need to solve it, too much and it's hard to find the key bit. I prefer the latter though, because otherwise I'd have to give you another release that shows more debug output or code in multiple verbosity levels which is a pain.) At some point I'll probably trim the visible output to the bare essentials and have it write a more verbose log file that you can examine or send me in the event of a problem.
Digital_Trucker
09-15-07, 09:57 AM
@ billko As minsc says in the above post, it actually put quotes around all text, not just the negative sign. However, nothing would surprise me when it comes to software differences. Standardization seems to be a bad thing because it implies a monoploy of sorts.
@NefariousKoel :rotfl: Yes, how dare they?:arrgh!:
@minsc Yep, it was my bad all around. Not looking at the original file, not noticing the lack of negativity in the debug output and not noticing that there is a choice in OpenOfficeCalc for the text delimiter (either single or double quotes, not that it would have made any difference). I'm usually pretty good at troubleshooting, but what threw me off was that everything else worked fine so I wasn't even thinking file discrepancies. Lesson learned, from now on I'll remember to strip the quotes out after I use Calc on it (better yet, just don't use Calc on it).
I think the idea of reducing the debug output in the command window and creating a log file is a good one. Much easier to deal with questions and troubleshooting that way, I think.
minsc_tdp
09-17-07, 08:39 PM
Howdy all, I just got back from my camping/hiking trip to Mt. Whitney. Unlike the 13 other fools that did the 18 hour death march 22 miles, I did a liesurely 8 mile hike to the lake where I relaxed reading a book. I actually bought the Dangerous Waters manual hoping to dig into that, but didn't have time to even crack it.
I'm glad to come back to see no major problems developing. I didn't put much thought into sh4speech while I was gone, so no Revelations From The Mountain so to speak. :) I think the only immediate goals I have are to clean up the debug output, and do some general cleanup that would enable better support of SH3. But I have no idea how interested those players might be as I've posted nothing about this in the SH3 forums.
panthercules
09-18-07, 12:02 AM
... and do some general cleanup that would enable better support of SH3. But I have no idea how interested those players might be as I've posted nothing about this in the SH3 forums.
Welcome back - sounds like you had a good trip - I'm sure it was nice to get away from all this for a while.
Been gone a few days myself, but was thinking about going back to SH3 for a bit (while waiting for Leo et al. to wrap up and release all the new graphics mods) and thinking about whether it would be worth trying to adapt SH4Speech to use it for that. I'd love to have the depth and course/mouse capability, but the problem I was getting stuck on was the language thing - with Shoot (what I've been using for SH3 voice command) it was really easy to add my German commands into the custom dictionary function, because that program doesn't seem to care or rely on any sort of English language recognition. Since SH4Speech relies on the Microsoft speech engine thingy, is it going to be able to recognize the German commands, or will you have to switch to a German version of the Microsoft speech engine or something? How hard do you think it would be to issue commands in German and have them work with SH4Speech?
mountainmanUK
09-18-07, 02:10 AM
I think the only immediate goals I have are to clean up the debug output, and do some general cleanup that would enable better support of SH3. But I have no idea how interested those players might be as I've posted nothing about this in the SH3 forums
Welcome back......and glad to hear you had a good time in the mountains!:D
So far as support for SH3 is concerned, I am 100% SURE that there are a heck of a lot of people that would really appreciate it, if you could come up with a couple of "basic" SH3Speech configurations......say, one for standard SH3 1.4b (patched Vanilla), and also a GWX v1.03 version.
As a dedicated SH3 user, and active in the Wolves at War Campaign, to be able to do almost everything in SH3 by voice alone would really make for possibly THE greatest aid to realism possible!!
I appreciate that all this takes time, and I'm pretty sure that you, like the rest of us, has a real life outside of SubSimming.....so it would be OK whenever you want to get into it!!!
When I do play SHIV these days (a lot less nowadays, since Wolves at War 3 started), I always use your SH4Speech setup. It is something that I really miss now, when I fire up my SH3!
cheers,
Dave
Digital_Trucker
09-18-07, 08:10 AM
Panthercules, if I am not mistaken, you can spell the German words phonetically in the command files and the speech engine should recognize them. For instance, to use my redneck dialect as an example, I had extreme difficulty getting the word "fire" recognized. But as soon as I changed the spelling to fierr it recognized my hillbilly pronunciation every time.
I would think that the same could be applied to the German language. I.E. Deutsch (forgive spelling if I got it wrong, it's been 30 years since I used the language) would become doitsh, Mein Herr would become mine hair (even though I don't have much :rotfl: ). I don't think a German speech engine would be necessary, just some creativity in spelling.
minsc_tdp
09-18-07, 03:16 PM
I believe getting proper german support in is two parts: First is to install and configure the MS Speech control panel settings appropriately to use a german language recognizer. While phonetic spellings might work I don't think that takes into account certain idiosyncracies of the language that the alternate Recognizers are designed to handle better.
Next would be figuring out why umlauts and any other german language specific character issues are properly supported in the files and scripts. As it stands, I believe that an umlaut in the file gets mangled by the time it passes through hear.exe and ultimately down to voice.exe and as a result the character just becomes a standard a instead of ä and this causes an inability to match. It'll take some work to sort it all out.
By far, the hardest work in supporting SH3 is defining the replacement entires for dials.csv. But perhaps it would be enough to get the three main dials in and not bother with the TDC and torpedo settings dial stuff until later.
panthercules
09-19-07, 01:51 AM
I believe getting proper german support in is two parts: First is to install and configure the MS Speech control panel settings appropriately to use a german language recognizer. While phonetic spellings might work I don't think that takes into account certain idiosyncracies of the language that the alternate Recognizers are designed to handle better.
Next would be figuring out why umlauts and any other german language specific character issues are properly supported in the files and scripts. As it stands, I believe that an umlaut in the file gets mangled by the time it passes through hear.exe and ultimately down to voice.exe and as a result the character just becomes a standard a instead of ä and this causes an inability to match. It'll take some work to sort it all out.
By far, the hardest work in supporting SH3 is defining the replacement entires for dials.csv. But perhaps it would be enough to get the three main dials in and not bother with the TDC and torpedo settings dial stuff until later.
Yeah - I would think that it would be enough to get the main 3 dials working (course/rudder, speed and depth) - that would already put you light-years ahead of the plain keystroke jobs like Shoot. I'll have to play around with the German version of the MS speech thingy (assuming there is one) and see - would SH4Speech work with the German version (or the English version tweaked to handle German, or however it works) of the MS speech thingy without you having to mess with it, or does it tie into the MS speech thingy in a way that would get broken if I tried to substitute the German version for the English one? Do you know whether the MS speech thingy has a custom dictionary function like Shoot does? That worked great for getting the Shoot engine to recognize German words, and I know some of the other (commercial) speech programs I've played with before had such a function - I think it was so you could add some technical jargon terms and stuff that the "mainstream" dictionary the programs used wouldn't normally have in it. I wonder how the MS speech thingy is setup in this regard - guess it's readme time :)
panthercules
09-19-07, 10:26 PM
Panthercules, if I am not mistaken, you can spell the German words phonetically in the command files and the speech engine should recognize them. For instance, to use my redneck dialect as an example, I had extreme difficulty getting the word "fire" recognized. But as soon as I changed the spelling to fierr it recognized my hillbilly pronunciation every time.
I would think that the same could be applied to the German language. I.E. Deutsch (forgive spelling if I got it wrong, it's been 30 years since I used the language) would become doitsh, Mein Herr would become mine hair (even though I don't have much :rotfl: ). I don't think a German speech engine would be necessary, just some creativity in spelling.
Well, I tried this and it does work, sort of, to some extent. For example, you can use "cline a fart for ows" as a reasonable facsimile for "kleine fahrt voraus", and "buy duh machine in stop" substitutes reasonably well for "beide machinen stopp" and it seems to recognize these ersatz German phrases most of the time. However, some of the German commands are just not that easy to simulate with English words/sounds, and even with these reasonably close matches recognition performance suffers quite noticeably.
I think you'd have to either (1) figure out how to use a German-based recognition engine (the readme for the MS speech thingy hinted that this might be possible but it didn't explain how to do that, and it appears that the application programmer (i.e., minsc_tdp) would probably have to build that capability into the Speech program); or (2) figure out how to add the capability Shoot has to be able to basically define your own words. Many speech programs allow you to do this, and they don't care whether you're adding some obscure English words (for legal or technical jargon terms, for example) or, in this case, some German words. In short, you just "train" the speech program so it knows when it hears "buy duh" you're actually saying "beide", and then it performs whatever key stroke or other command you told it to perform when it hears you say "beide" - it doesn't have to know or care that "beide" is German and not English.
At least, that's the way Shoot seems to do it, and it seems like it's probably the best way to approach this problem for making SH4Speech work with SH3 (easy for me to say - I don't have to program it :lol: ) Based on my experience with Shoot/SH3, you don't really have to add all that many German words to the program's lexicon/dictionary through "training" to be able to create the commands you need to speak, so I hope something like this could be done - I'd love to use this with SH3 too.
minsc_tdp
09-20-07, 12:04 AM
Nein! I would strongly recommend that nobody pursue the route of phonetic equivalents unless they're really desperate. It is very likely a dead end.
sh4speech should use whatever recognizer (aka, an MS SAPI compatible speech engine) you have currently selected in Control Panel > Speech. Mine is "Microsoft English Recognizer 5.1". Presumably there's a way to install a "German Recognizer"!!?
According to the internet tubes (sorry lost the link!), it says:
"The speech recognition engine may be installed with the operating system or at a later time with other software. During the installation process, speech-enabled packages such as word processors and web browsers, may install their own engines or they may use existing engines. Additional engines are also available through third-party manufacturers. These engines often use a certain jargon or vocabulary; for example, they may use a vocabulary that specializes in medical or legal terminology. They can also use different voices allowing for regional accents such as British English, or use a different language altogether such as German, French, or Russian."
So you may have to buy a Microsoft SAPI compatible German recognizer. You probably want this:
http://www.nuance.de/naturallyspeaking/
frenzied
09-20-07, 01:23 AM
I've been having a fairly strange, but minor, problem with this - whenever the program opens, or resets itself, it turns my microphone volume down to 0.
Any ideas on what could be causing this?
minsc_tdp
09-20-07, 04:27 PM
I've been having a fairly strange, but minor, problem with this - whenever the program opens, or resets itself, it turns my microphone volume down to 0.
Any ideas on what could be causing this?
Have you been through the Microphone Tuning Wizard in Control Panel > Speech? That might be governing the mic volume and it's resetting to that each time SAPI gets instantiated (which is when sh4speech starts or restarts each 10 minutes) and it is by design.
panthercules
09-23-07, 11:56 AM
After getting tired of having to speak the command to "secure the stopwatch" every time I called for TC 512 or higher, it finally dawned on me that the same macro string I created to order the TC 512 in the first place could be easily adapted to include the command key to remove the stopwatch, and Voila! - no more stopwatch :yep:
Minsc_tdp - gotta hand it to you - the power of what you've done here just keeps revealing itself the more one plays around with it. Now you've made possible a fix for what has to be one of the most annoying little stupidities in the game - Way to go man :rock:
For those interested, adding these commands is really easy - for ordering TC 512, you use the macro capability built into SH4Speech to add the following line in the "keys" column (column E, I believe) to your key_commands.csv file (use whatever ID # you want/have available and call it whatever you want - I call it simply "TC 512" in mine):
SHIFT-Numpad -&Numpad +&Numpad +&Numpad +&Numpad +&Numpad +&Numpad +&Numpad +&Numpad +&Numpad +&X
You'll also need to add the key code for "SHIFT-Numpad -" (which is the key for setting TC=1, which is used at the start of the sequence to make sure the macro is increasing TC by the right number of times to get to 512) to your key_codes.csv file - it's easy to do, and the code is "0x10+0x6D"
Then you just add a line to your voice_commands.csv file so you can speak whatever you want to say for TC 512 (I just use "T C five twelve") and voila! The time compression goes to 512, the stopwatch pops up and immediately goes away :D
You can do basically the same thing for the higher TC settings, just by stringing together longer series of "&Numpad +" and making sure that the "&X" is the last thing in the string, and the stopwatch will always disappear when you order TC of 512 or higher.
Enjoy!
minsc_tdp
10-24-07, 05:58 PM
I recently attended E for All, a mini-E3 video game conference in Los Angeles. I tossed around my idea of modifying sh4speech to work with any game, to have a generic SDK and I got some really good feedback. I got some interesting ideas as to other types of software this might be applicable to. I'm still skeptical that there's any value here and I still need to follow up with the contacts I made, but there might be more in store for sh4speech yet. It might become a sort of generic "GameVoice" app that can be licensed by game developers for inclusion with their software, or a generic app that the communities use to tune for each game.
One of the most interesting problems is that in games like flight sims, the HUD is not static like sh4, it moves around, so the location of dials and buttons tends to change in realtime. Locating them would require a datastream from the game so that their location can be pinned down, or even better, a strong API that would allow me to set their values without worrying about where they are and not having to take over the mouse. So there's a lot of think about. This post was really just a weak excuse to bump this thread I love so much back into the main page. :)
minsc_tdp
10-24-07, 07:32 PM
Hey I'm messing around with this LinkedIn site. Here's my public profile:
http://www.linkedin.com/pub/5/984/45a
I'd apprecate if anyone who has used sh4speech, likes it, and has an account there (or is willing to create one) would add me as a friend/connection/whatever and put in a recommendation with glowing reviews of my work. :) Thanks!
Hawk_345
12-09-07, 11:48 AM
I think i might give this thing a go, but first i need to know if its 1.4 cmpatible, and if you need to be a computer genius to install it and make it work. also on a side note, if i do manage to install this thing, will it afect the use of the Teamspeak program, and if i want to uninstall it, will i have to reinstall the whole game.
panthercules
12-09-07, 03:55 PM
I think i might give this thing a go, but first i need to know if its 1.4 cmpatible, .
It should be - it's really its own standalone application that does not appear to install into the game folders or otherwise depend upon any particular SH4 patch version. I've used it a few times since the patch and have not seen any problems with it.
and if you need to be a computer genius to install it and make it work. .
No - it was a little tricky during the early development phases, but the current version has greatly simplified the install process and it's really very simple now. If you want to customize it with your own commands and stuff like I do, that will take a little bit of familiarity with Excel and stuff, but even that's not that tough (and I'm no computer genius) and you don't have to mess with any of that stuff to still have a great time with this in the pure "stock" version that minsc_tdp has given us.
also on a side note, if i do manage to install this thing, will it afect the use of the Teamspeak program .
It shouldn't - it's a self-contained application and I've never had any problems/conflicts between it and either Teamspeak or Ventrillo. Of course, I only play SH4 single-player, and I've never tried running them at the same time, so I'm not sure what would happen if you tried to use this and Teamspeak together while playing SH4.
and if i want to uninstall it, will i have to reinstall the whole game.
No - as far as I can tell, the install/operation of SH4Speech doesn't seem to alter or affect the actual SH4 game file structure, so I don't see any reason why uninstalling SH4Speech would have any effect on whether or not you uninstall the game.
All of the above is my opinion based on my experience with it as an avid SH4Speech fan and long-time tester and user - I believe it is accurate but I don't have much clue as to the internal workings of the program itself so I'm sure minsc_tdp could give you more detailed answers if you need them.
Hawk_345
12-09-07, 06:21 PM
yeah thanks, i hope i can get this thing to work.
minsc_tdp
12-10-07, 12:06 AM
Just a quick update. I haven't been posting to threads much but I log into subsim almost daily to check private messages in case anyone needs help. So feel free.
GhengasCon is working on modding this for SH3. Ping and harass him if you want to know the status. I'm supporting his effort with the little time I have and if things get dicey I'll make time and dive in to finish it up.
Everything panther said to hawk is correct. I will amplify a little:
> 1.4 compatible?
Haven't tried myself, haven't even played 1.4 yet. I rarely play SH4 at all, heh. But assuming they didn't move any on-screen buttons or dials around, and all the key mappings are the same, it will work.
>have to be a genius to use?
Unzip, run the BAT file to launch. That's it. Doesn't even have an installer and runs from wherever you unzipped it to, I'm pretty sure! I've worked hard to make it VERY simple.
>affect Teamspeak?
If teamspeak is *running* it could have an effect. Generally only one program of any kind can listen to the mic at any time, I think, but I could be wrong, and it might work for both at once - if you really wanna try to make this work, I would advise using the "push to talk" mode of sh4speech (see readme) and the same for Teamspeak, and assign a seperate button to TeamSpeak's "push to talk" mode than sh4speech is using. Do this, and they just *might* work together. Worst case, you simply have to make sure Teamspeak isn't running.
>affects the game during install/uninstall?
Not at all. The files are *completely* seperate from sh4, it doesn't touch a single file. Doesn't even read them. It doesn't even know where sh4 is! It directly interfaces to the keyboard and mouse - sh4 doesn't even *know* it's doing anything!
Thanks everyone!
yeah thanks, i hope i can get this thing to work.
It's really easy to get working. The first time you say "dive!" and the helmsman looks at you and replies "yes, sir. bow planes set for normal dive!" you'll be hooked. :)
Bill
Sockeye
12-22-07, 02:31 PM
Just started using SH4Speech yesterday because I've had trouble with other speech applications in the past, usually stemming from a delay between speaking and response.
SH4Speech is pretty damn good though!
Response is near-instantaneous on my rig, and after customizing some of the voice phrases, I can really get into it.
"Make ready tube one..." tube one opens, followed by the rest in the spread
"Connect tube one..." tube one is selected
"Standby one..." a backup "open" command just in case
"Fire one!" and away she goes
"Connect tube two..."
Well, you get the idea :arrgh!:
Now all I need is Kraut Mueller saying "One fired electrically!" :up:
gday guys,
just bought sh4 yesterday and was looking to download the speech mod however the link seems down. any thoughts on where i can download from ?
thanks
Thndr
Digital_Trucker
12-27-07, 08:07 PM
Looks like his server is having some problems. I upped my copy of the download to filefront and you can download it at http://files.filefront.com/sh4speech22zip/;9336178;/fileinfo.html
thank you very much mate .... very helpful indeed :up:
minsc_tdp
12-28-07, 04:40 PM
Downloads were temporarily down. Fixed!
minsc_tdp
02-05-08, 07:53 PM
Hi everyone! A big surprise is in the works for sh4speech. Stay tuned!
vBulletin® v3.8.11, Copyright ©2000-2025, vBulletin Solutions Inc.