View Single Post
Old 03-02-11, 02:18 PM   #250
stoianm
Ocean Warrior
 
Join Date: Dec 2010
Location: Montreal, Canada
Posts: 2,776
Downloads: 833
Uploads: 11
Default

Quote:
Originally Posted by MiTon View Post
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
very interesting - so in this way i can change in romanian for example if i want... i will give a try and come back with more quest - thanks for your post

cheers
stoianm is offline   Reply With Quote