F1 2012 Use your voice to control fuel, brake bias and so on!

F1 2012 The Game (Codemasters)
Changing fuel, tyres and brakes too much work? Not enough buttons on your wheel for all those macros? There's a mighty 'button' available: your voice!
Demonstration:
Hardware needed:
- a microphone (even very cheap one will do)
Software needed:
- GlovePIE (I use version 0.43) it's free and available from various sources, such as http://glovepie.org/GlovePIEWithoutEmotiv043.zip
When the program has opened, you can start writing a script. To get you started very quickly, here's mine with some instructions included:
When finished writing you can save it, and then run it. Enjoy!
Code:
//GlovePIE script created by Chicane
//In this script: Make fuel choices, tyre choices and brake bias choices with YOUR VOICE in F1 2012! Also added: Car Status switch and instantly restart your time trial hotlap.
//INSTRUCTIONS
//set your ingame quickmenu keys to WASD-keys and car status to Q-key or edit this script
//if your voice isn't understood very well or your mic is worse than awful, try changing the green 3 after ", and in front of ) to another value from 0 to 6. It's a tolerance setting. Default = 2
//you should leave a couple of seconds between 2 commands, else the 2nd command may not be executed correctly. This is the same with using scripts in for example Logitech Profiler when creating macros so the problem is somewhere ingame. Experiment to find out whatever is the cross-over point.
//The list of possible commands, actions ande scripts is huge. Have a read through the documentation to learn more. GlovePIE forum: http://glovepie.org/forum/index.php
//END OF INSTRUCTIONS
//I've managed to create this script thanks to other people sharing their knowledge, and therefore I'm sharing this too! You're allowed to adjust and share this script.
//disclaimer: Script has been tested with English version of Windows7, and English language version of the game. I take no responsibility fole for any damage (including hardware, software and your voice) by using (parts of) this script.
 
//ACTIVATE AND IGNORE MICROPHONE OPTIONS
//Microphone.Enabled = joystick.Button11 //button is 3rd gear on the H-shifter of G27, option to only let the script execute commands when you hold this button. Can be useful if you're on voice communication with others, such as Teamspeak and you do NOT use push-to-talk in Teamspeak. Adjust the button to your liking.
Microphone.PushToNotTalk = joystick.Button12 // (when in 4th h-shifter gear on G27) option to only let the script execute commands when you DON'T hold this button. Can be useful if you're on voice communication with others, such as Teamspeak and you use push-to-talk in Teamspeak. Adjust the button to your liking.
 
//FUEL MIX CHOICES
IF Said("mix three",3)// Adjust between the "" what you want to say to activate mix3/rich fuel.
//say "confirmed" I'd recommend not to use extra audio confirmation, but it's possible to do so. You could even add different kinds of confirmations for different actions.
press w
wait 40ms //if game doesn't fully execute your voice commands, try making the wait times longer.
release w
wait 40ms
  press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
endif
 
IF Said("mix two",3)
press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
wait 40ms
  press d
wait 40ms
release d
endif
 
IF Said("mix one",3)
press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
wait 40ms
  press key.s
wait 40ms
release key.s
endif
 
//TYRE CHOICES
IF Said("prime tyres",3)
press w
wait 40ms
release w
wait 40ms
  press d
wait 40ms
release d
wait 40ms
  press w
wait 40ms
release w
endif
 
IF Said("option tyres",3)
press w
wait 40ms
release w
wait 40ms
  press d
wait 40ms
release d
wait 40ms
  press d
wait 40ms
release d
endif
 
IF Said("intermediate tyres",3)
press w
wait 40ms
release w
wait 40ms
  press d
wait 40ms
release d
wait 40ms
  press key.S
wait 40ms
release key.S
endif
 
IF Said("full wet tyres",3)
press w
wait 40ms
release w
wait 40ms
  press d
wait 40ms
release d
wait 40ms
  press a
wait 40ms
release a
endif
 
//BRAKE BIAS CHOICES
IF Said("Brakes front",3)
press w
wait 40ms
release w
wait 40ms
  press key.S
wait 40ms
release key.S
wait 40ms
  press w
wait 40ms
release w
endif
 
IF Said("Brakes normal",3)
press w
wait 40ms
release w
wait 40ms
  press key.S
wait 40ms
release key.S
wait 40ms
  press d
wait 40ms
release d
endif
 
IF Said("Brakes rear",3)
press w
wait 40ms
release w
wait 40ms
  press key.S
wait 40ms
release key.S
wait 40ms
  press key.S
wait 40ms
release key.S
endif
 
//CYCLE CAR STATUS
IF Said("Car status",3)
press key.Q
wait 40ms
release key.Q
endif
 
//INSTANTLY RESTART TIME TRIAL HOTLAP
IF Said("restart time trial",3)
press key.Escape
wait 40ms
release keys.Escape
wait 40ms
press key.up
wait 40ms
release key.up
wait 40ms
press key.up
wait 40ms
release key.up
wait 40ms
press key.up
wait 40ms
release key.up
wait 40ms
press key.Enter
wait 40ms
release key.Enter
wait 40ms
Press key.Down
wait 40ms
release key.Down
wait 40ms
press key.Enter
wait 40ms
release key.Enter
endif
 
//'DEBUGGING'
//I have not tested this, but these 'debug lines' may actually work, so you get feedback why a command isn't executed. Remove the // to use
//if Microphone.TooFast then say(“Don’t talk so fast.”)
//if Microphone.TooSlow then say(“You need to talk faster.”)
//if Microphone.TooLoud then say(“Stop shouting. I’m not deaf.”)
//if Microphone.TooQuiet then say(“Speak up, I can’t hear you.”)
//if Microphone.HeardNoise then say(“I can’t hear you over the noise.”)
 
Can you make a tutorial video , how to do this?Because no matter how loud mine noise is, it's not detecting it.I have a headset with microphone on it(genious very cheap one:D).
 
Hi guys,

I've been messing about a bit more with this and thought I'd share a few more voice mappings I compiled to add to Rob's ones. Tested and working for me with my G27.

They are return to garage, go out on a flying lap from the garage, drive out of the garage and adjust fuel to qualifying load (in this case 5 laps).

Brilliant idea Rob, and some good extra commands Misty - I must try this. Now I can say 'ready to go' and they will fire the car up, or 'I need options' and the engineer will respond ! Makes it even more immersive, thanks.
 
  • Like
Reactions: Tom
Can someone help me?Why can't i get this to work?
To find out if your microphone is causing the trouble:
run my original script, and open notepad. If you say the commands such as "mix 3" "option tyres" and so on, it should automatically type WWW or WDD and so on.
If this doesn't work already, then it's probably your mic.

It could also be a matter of language, I don't know you have windows 7 in english. If you have it in another language, I don't know if you have the english Speech API or not. You'll have to google a bit on it (SAPI 5.1 or 5.4 and site:microsoft.com should get you started)

To be clear: everyone with english windows 7 version should have the Speech API already.

If you want to use words in your own language in the script, then maybe you should try finding English words that sounds moreless the same.

Gonna try this today, any idea how I would bind the Fanatec CSR hat buttons instead of WSAD because they are used for navigating the menus and I don't want to have to use the keyboard for that :)
don't know about the hat buttons. You'll have to try multiple things. Most wheels in Glovepie are 'recognized' as joystick.
If you type joystick. (so with the .) the program gives a list of suggestions what can come after the dot.
Alternatively you can look in the documentation rtf file (which is in the same folder as the .exe), or look on the glovepie forum. Good luck!
 
They show as dpadup etc ingame I think so should I try that?
you can always try. The script is just a start-script that everyone should customize to their liking. I can't predict how things will work out with different hardware and/or different languages.
In fact, I think there's a chance that even if you do bind it to WASD ingame for quickmenu, you can still use dpad to navigate through main menu.
 
Well I tried re naming them to dpad0up etc but the line had a bit red strip through them in the Glovepie program and didn't work ingame. I tried the original wsad etc and it works great :D such a good idea, thanks for this and if anyone comes up with any more command please share them

If I want options but want to say something different how do I do that? do I just type it in?
 
Hm, didn't work for me. The debug menu lists something like

New guess: option tyres
You didn't say: option tyres, 3

Pretty weird. I'll try to install the English API tomorrow. I'm using Win 7 Pro 64, French DVD (set to German).
 
I haven't had chance to use it yet. To those who are running it succesfully - are you using a headset or does it work with a normal desktop mike? I presume a desktop mic would pickup all the background noise from the speakers and so not work properly?
 
To find out if your microphone is causing the trouble:
run my original script, and open notepad. If you say the commands such as "mix 3" "option tyres" and so on, it should automatically type WWW or WDD and so on.
If this doesn't work already, then it's probably your mic.

It could also be a matter of language, I don't know you have windows 7 in english. If you have it in another language, I don't know if you have the english Speech API or not. You'll have to google a bit on it (SAPI 5.1 or 5.4 and site:microsoft.com should get you started)

To be clear: everyone with english windows 7 version should have the Speech API already.

If you want to use words in your own language in the script, then maybe you should try finding English words that sounds moreless the same.


don't know about the hat buttons. You'll have to try multiple things. Most wheels in Glovepie are 'recognized' as joystick.
If you type joystick. (so with the .) the program gives a list of suggestions what can come after the dot.
Alternatively you can look in the documentation rtf file (which is in the same folder as the .exe), or look on the glovepie forum. Good luck!
I already mapped it to wasd and q key.I don't know what did i do wrong.Maybe i shouldn't have pasted this command:
Microphone.PushToNotTalk = joystick.Button12 // (when in 4th h-shifter gear on G27) option to only let the script execute commands when you DON'T hold this button. Can be useful if you're on voice communication with others, such as Teamspeak and you use push-to-talk in Teamspeak. Adjust the button to your liking.
And i have hungarian win7 installed, maybe this is what causing trouble?
I have logitech g25 and i don't understand that i should be in 4-th gear to get this to work or what else?
 
My script looks like this(button 18 is on my g25):
//FUEL MIX CHOICES
IF Said("mix three",4)
//say "confirmed"
press w
wait 50ms
release w
wait 50ms
press w
wait 50ms
release w
wait 50ms
press w
wait 50ms
release w
endif

IF Said("mix two",4)
press w
wait 50ms
release w
wait 50ms
press w
wait 50ms
release w
wait 50ms
press d
wait 50ms
release d
endif

IF Said("mix one",4)
press w
wait 50ms
release w
wait 50ms
press w
wait 50ms
release w
wait 50ms
press key.s
wait 50ms
release key.s
endif

//TYRE CHOICES
IF Said("prime tyres",4)
press w
wait 50ms
release w
wait 50ms
press d
wait 50ms
release d
wait 50ms
press w
wait 50ms
release w
endif

IF Said("option tyres",4)
press w
wait 50ms
release w
wait 50ms
press d
wait 50ms
release d
wait 50ms
press d
wait 50ms
release d
endif

IF Said("intermediate tyres",4)
press w
wait 50ms
release w
wait 50ms
press d
wait 50ms
release d
wait 50ms
press key.S
wait 50ms
release key.S
endif

IF Said("full wet tyres",4)
press w
wait 50ms
release w
wait 50ms
press d
wait 50ms
release d
wait 50ms
press a
wait 50ms
release a
endif

//BRAKE BIAS CHOICES
IF Said("Brakes front",4)
press w
wait 50ms
release w
wait 50ms
press key.S
wait 50ms
release key.S
wait 50ms
press w
wait 50ms
release w
endif

IF Said("Brakes normal",4)
press w
wait 50ms
release w
wait 50ms
press key.S
wait 50ms
release key.S
wait 50ms
press d
wait 50ms
release d
endif

IF Said("Brakes rear",4)
press w
wait 50ms
release w
wait 50ms
press key.S
wait 50ms
release key.S
wait 50ms
press key.S
wait 50ms
release key.S
endif

//CYCLE CAR STATUS
IF Said("Car status",4)
press key.Q
wait 50ms
release key.Q
endif

//INSTANTLY RESTART TIME TRIAL HOTLAP
IF Said("restart time trial",4)
press key.Escape
wait 50ms
release keys.Escape
wait 50ms
press key.up
wait 50ms
release key.up
wait 50ms
press key.up
wait 50ms
release key.up
wait 50ms
press key.up
wait 50ms
release key.up
wait 50ms
press key.Enter
wait 50ms
release key.Enter
wait 50ms
Press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Enter
wait 50ms
release key.Enter
endif

//INSTANTLY RETURN TO GARAGE
IF Said("return to garage",4)
press key.Escape
wait 50ms
release keys.Escape
wait 50ms
press key.up
wait 50ms
release key.up
wait 50ms
press key.up
wait 50ms
release key.up
wait 50ms
press key.Enter
wait 50ms
release key.Enter
wait 50ms
Press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Enter
wait 50ms
release key.Enter
endif

//INSTANT FLYING LAP
IF Said("flying lap",4)
press key.Escape
wait 50ms
release keys.Escape
wait 50ms
Press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Enter
wait 50ms
release key.Enter
wait 50ms
Press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Enter
wait 50ms
release key.Enter
endif

//INSTANT DRIVE OUT
IF Said("drive out",4)
press key.Escape
wait 50ms
release keys.Escape
wait 50ms
Press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Enter
wait 50ms
release key.Enter
wait 50ms
press key.Enter
wait 50ms
release key.Enter
endif

//INSTANT LOW FUEL
IF Said("qualifying fuel",4)
press key.Enter
wait 50ms
release key.Enter
wait 50ms
press key.Right
wait 50ms
release key.Right
wait 50ms
press key.Right
wait 50ms
release key.Right
wait 50ms
press key.Right
wait 50ms
release key.Right
wait 50ms
press key.Enter
wait 50ms
release key.Enter
wait 50ms
press key.Enter
wait 50ms
release key.Enter
wait 50ms
press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Down
wait 50ms
release key.Down
wait 50ms
press key.Left
wait 50ms
release key.Left
wait 50ms
press key.Left
wait 50ms
release key.Left
wait 50ms
press key.Left
wait 50ms
release key.Left
wait 50ms
press key.Left
wait 50ms
release key.Left
wait 50ms
press key.Left
wait 50ms
release key.Left
wait 50ms
press key.Escape
wait 50ms
release keys.Escape
wait 50ms
press key.Escape
wait 50ms
release keys.Escape
wait 50ms
press key.Escape
wait 50ms
release keys.Escape
endif

Microphone.PushToNotTalk = Button18

if Microphone.TooFast then say(“Don’t talk so fast.”)
if Microphone.TooSlow then say(“You need to talk faster.”)
if Microphone.TooLoud then say(“Stop shouting. I’m not deaf.”)
if Microphone.TooQuiet then say(“Speak up, I can’t hear you.”)
if Microphone.HeardNoise then say(“I can’t hear you over the noise.”)
 

Latest News

How often do you meet up (IRL) with your simracing friends?

  • Weekly

    Votes: 36 8.5%
  • Monthly

    Votes: 20 4.7%
  • Yearly

    Votes: 29 6.9%
  • Weekly at lan events

    Votes: 3 0.7%
  • Monthly at lan events

    Votes: 2 0.5%
  • Yearly at lan events

    Votes: 10 2.4%
  • Never have

    Votes: 331 78.3%
Back
Top