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.”)
 
Wow Rob! Thats a great idea, and most of all it works.
Only problem for me is that i like to use my speakers to play, and my only mic is on a sony wireless headset which covers my ears and i'll not hear anything else :roflmao:
But with a headset without the speakers, just the mic, plus a head tracking device and this, just perfect! :thumbsup:
 
So all I need is "bollocks" = Reset to Track :D ;)
didn't think of that, and I don't like it when people use 'reset to track' online, but it's easy to code in. You only need to know when the game gives you the option in the menu to use reset to track, or spread it over 2 commands.

Can we make it so I can say 'kkkkeeeeeeeeeeeeeeeeerrrrrrrrrrrrrrrrrrrssssssssssss' and as long as you hold it it activates kers and when you stop muttering its stops :D:p.
I wouldn't be surprised if it was possible to code in some way. Didn't go through all documentation.:p
But on a serious note: there's of course a little lag between saying the command and when it's executed, so you shouldn't use it on stuff like KERS and DRS where timing is critical.
 
I had such a great time racing with this this evening, it's really brought the game alive. We have a G27 here and the quick menu controls are off on the shifter - it's not always that easy to access. But with this program I'm able to adjust brake bias for every significant corner (gained me a new PB some 0.4 sec better in India) and change my fuel mix on the straights.

Now I just have to think of some other things to map.

Thanks again!
 
"CURSE YOU! GIVE ME THEM SOFT RUBBERS!"

Here you go ....... 3 full sets! :)

durex.jpg
 
Can you tell me how i can bind the voice activation to Xbox360 gamepad because my wheel isnt here.
The script is written in such a way that you should map that quickmenu keys to W A S D.
But if you want to keep em on the pad, you may try replacing every W in the script with joystick.Pov1Up , every D with joystick.Pov1right, every key.s with joystick.Pov1down and every A with joystick.Pov1left. Not sure though if it works, you'll have to try yourself.
Basically you just have to make sure that the assigned ingame buttons match the buttons in the script.
 
The script is written in such a way that you should map that quickmenu keys to W A S D.
But if you want to keep em on the pad, you may try replacing every W in the script with joystick.Pov1Up , every D with joystick.Pov1right, every key.s with joystick.Pov1down and every A with joystick.Pov1left. Not sure though if it works, you'll have to try yourself.
Basically you just have to make sure that the assigned ingame buttons match the buttons in the script.

It doesn't work.
 
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). The last one I find useful as every time I go back to the garage in practice it resets my fuel to 10 laps, which is not ideal when I'm doing a few quali simulation runs. It assumes you are facing the driver monitor (not the engineer menu), and obviously that you're in practice, otherwise you will have only 5 laps onboard anyway. Career mode only. [Edited to add that the setup menu always starts where you last left off within it (so if you adjusted toe last it starts there when you click on the setup), so you must have chosen your fuel load as your last manual setup command]

Code:
 //INSTANTLY RETURN TO GARAGE
IF Said("return to garage",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.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
 
//INSTANT FLYING LAP
IF Said("flying lap",3)
press key.Escape
wait 40ms
release keys.Escape
wait 40ms
Press key.Down
wait 40ms
release key.Down
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
 
//INSTANT DRIVE OUT
IF Said("drive out",3)
press key.Escape
wait 40ms
release keys.Escape
wait 40ms
Press key.Down
wait 40ms
release key.Down
wait 40ms
press key.Enter
wait 40ms
release key.Enter
wait 40ms
press key.Enter
wait 40ms
release key.Enter
endif
 
//INSTANT LOW FUEL
IF Said("qualifying fuel",3)
press key.Enter
wait 40ms
release key.Enter
wait 40ms
  press key.Right
wait 40ms
release key.Right
wait 40ms
  press key.Right
wait 40ms
release key.Right
wait 40ms
press key.Right
wait 40ms
release key.Right
wait 40ms
press key.Enter
wait 40ms
release key.Enter
wait 40ms
press key.Enter
wait 40ms
release key.Enter
wait 40ms
press key.Down
wait 40ms
release key.Down
wait 40ms
press key.Down
wait 40ms
release key.Down
wait 40ms
  press key.Left
wait 40ms
release key.Left
wait 40ms
  press key.Left
wait 40ms
release key.Left
wait 40ms
  press key.Left
wait 40ms
release key.Left
wait 40ms
  press key.Left
wait 40ms
release key.Left
wait 40ms
  press key.Left
wait 40ms
release key.Left
wait 40ms
press key.Escape
wait 40ms
release keys.Escape
wait 40ms
press key.Escape
wait 40ms
release keys.Escape
wait 40ms
press key.Escape
wait 40ms
release keys.Escape
endif
 
didn't think of that, and I don't like it when people use 'reset to track' online, but it's easy to code in. You only need to know when the game gives you the option in the menu to use reset to track, or spread it over 2 commands.


I wouldn't be surprised if it was possible to code in some way. Didn't go through all documentation.:p
But on a serious note: there's of course a little lag between saying the command and when it's executed, so you shouldn't use it on stuff like KERS and DRS where timing is critical.
Hey , will this work with my g25?Can you help me?For example the option tyres in mine language means"lágy gumi" , will the program detect this command if i say this in microphone?Or it's not possible?Thank you in advance for your assistance:)
 

Latest News

How long have you been simracing

  • < 1 year

    Votes: 319 15.5%
  • < 2 years

    Votes: 218 10.6%
  • < 3 years

    Votes: 213 10.4%
  • < 4 years

    Votes: 159 7.7%
  • < 5 years

    Votes: 276 13.4%
  • < 10 years

    Votes: 238 11.6%
  • < 15 years

    Votes: 154 7.5%
  • < 20 years

    Votes: 120 5.8%
  • < 25 years

    Votes: 92 4.5%
  • Ok, I am a dinosaur

    Votes: 266 12.9%
Back
Top