SUBSIM Radio Room Forums



SUBSIM: The Web's #1 resource for all submarine & naval simulations since 1997

Go Back   SUBSIM Radio Room Forums > Silent Hunter 3 - 4 - 5 > SH5 Mods Workshop
Forget password? Reset here

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
Old 03-02-11, 02:08 PM   #11
MiTon
Sparky
 
Join Date: Apr 2010
Location: Germany
Posts: 157
Downloads: 270
Uploads: 2
Default

Hi kalijav,


for translation you got to modify three files:
1. in data\Scripts\Menu\Speech Recognition.py change
Code:
speech = SHSpeechEngine("en-US")
to the value of your desired language pack (there has to be one for Microsoft Speech Recognition)
If you want to use commands that are not covered by Documentation\Game_Commands.txt, you got to alter the way commands are executed in this Python file
(this is the case for some of the commands containing the port or starbord)
If you don't use the already included ones, this is where a little coding is required.

2.
data\Sound\Speech\SHSpeech_Grammar.xml
contains the Grammar for the commands you can give. You got to translate the "items".
Code:
<!-- Speed -->
            <item>
                    <item>
                        <item repeat="0-1">all</item>
                    </item>
                 <one-of>
                    <item>back</item>
                    <item>ahead</item>
                </one-of>
                <one-of>
                    <item>slow</item>
                    <item>1/3</item>
                    <item>2/3</item>
                    <item>standard</item>
                    <item>full</item>
                    <item>flank</item>
                    <item>emergency</item>
                </one-of>
            </item>
This defines possible commands like:
ahead 1/3
...
back emergency
....

3.

in data\Sound\Speech\SHSpeech_Commands.xml

these frases are used to link the to the commands:

Code:
<order>
            <phrase>ahead 2/3</phrase>
            <phrase>ahead standard</phrase>
            <phrase>all ahead standard</phrase>
            <commandText>Ahead_standard</commandText>
 </order>
<phrase></phrase> can contain the frases you have defined in SHSpeech_Grammar.xml
<commandText></commandText> contains the command from Game_Commands.txt you want to execute or a new command, which you
have to define in Speech Recognition.py


Maybe you should have a look at these posts 91 an on in this thread!

It worked for german but I can't give you a guarantee that it'll work for you.
Start with just one command and test it with the included SpeechEngineTest.exe. If it's recognized then you can try it in SH5.
You should also activet the Script Manager see:
http://www.subsim.com/radioroom/showthread.php?t=162702

With activated Script Manager you can deactivate and activate your translation with JSGME during play to test your commands. When you alter and save Speech Recognition.py in the Script Manager (just add an empty line and apply changes) the altered files are loaded!

Greets

MiTon
MiTon is offline   Reply With Quote
 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 01:26 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
Copyright © 1995- 2025 Subsim®
"Subsim" is a registered trademark, all rights reserved.