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.”)
 
It's the same thing I was thinking about.
Wanted to test it on an older computer, but I couldn't get the microphone working at all on that thing. So good luck testing and please let me know if it worked.
I'll test it tomorrow morning and i'll let you know if it's worknig:).Did you read my script?Nothing is wrong with it?And will it work with my headset(i have a mic on it)
 
Such a great feature. Works really well on my side. I spent some time with debug console, just to verify all the commands are recorded and translated correctly. I had to boost my mic and in the script chaged the commands from 40ms to 80ms, than you can actualy see the commands happen in game. I'm Windows 7 64bit user in czech language.
Thank you so much.
 
The only thing wrong with it is 'button18' (which should most likely be joystick.button18) but this shouldn't cause the script to not work at all I think.
Hey,man.I don't know what i do wrong but it still not work even with speech api 5.1 installed.Can you help me?Please upload a tutorial video on youtube or can you show me screenshot of your f1 2012 controll settings?And what wheel do you use?I already rewritten the button 18 to joystick.
 
If you do not change the script, you need to change your ingame Quick menu keys to WASD (and Q if you want to use the car status switch). All the other buttons don't matter.
So the quickmenu buttons ingame look like this:

FD4254F25F893EC9B0DC2D616FB690B00193E7B8
 
But to be very clear. The script itself must already be working in notepad without steering wheel plugged in, or F1 2012 loaded. if you say "mix 3" it should type WWW when the cursor is in notepad (so when you can type there yourself.

Make sure the script is in 'running state' by pressing 'run'. When it's in running state it says so on the top and the button changes to stop (circled red in this screenshot):
screenshot.png
 
I also noticed you changed the recognition value in the script from 3 to 4. I'd recommend trying default first, or even try different values and see what values give a response. Here's what the values do:
Code:
  0 = no confidence (false recognition)
  1 = low confidence guess, 2 = medium conf guess (default), 3 = high conf guess
  4 = low conf full recognition, 5 = medium conf full recog, 6 = high conf recog
 
I also noticed you changed the recognition value in the script from 3 to 4. I'd recommend trying default first, or even try different values and see what values give a response. Here's what the values do:
Code:
  0 = no confidence (false recognition)
  1 = low confidence guess, 2 = medium conf guess (default), 3 = high conf guess
  4 = low conf full recognition, 5 = medium conf full recog, 6 = high conf recog
I tryed this way too,it's not working.What am i doing wrong?Or my mic sucks is that it?In game audio settings i have voice communication enabled and push to talk which is set to "T" button keyboard.So what's wrong?My skype easly detect my voice it's only this script which is fooling with me.
 
if you need to make sure you're mic is actually working:
windows button, in the search field type 'sound recorder' (or the equivalent in your own language), press the record button and say test or whatever a few times, press stop, save the file, play the file and then you know what the mic is actually recording.
If it's your voice, and you understand yourself what you're saying then I'm out of ideas why the script isn't working for you.
 
if you need to make sure you're mic is actually working:
windows button, in the search field type 'sound recorder' (or the equivalent in your own language), press the record button and say test or whatever a few times, press stop, save the file, play the file and then you know what the mic is actually recording.
If it's your voice, and you understand yourself what you're saying then I'm out of ideas why the script isn't working for you.
I tried this and this works, but i guess my microphone sound is too low.Should i make the sound of it higher to detect it?
 
wow!! Chapeau for this mod, great stuff. I haven't read all the replies and maybe someone already asked for it. Could someone add the "look left/right" feature???

A good idea to map the left and right feature, I'd been thinking of doing it too. The issue is how long do you tell the program to hold down the button, as that will dictate how long you look.

Here's my quick take on it, and the look back feature as well. The key C must on the keyboard be mapped to left in the game settings, V to look right, and B to rearview or look back.

Code:
 IF Said("left",3)
press c
wait 500ms
release c
endif
 
  IF Said("right",3)
press v
wait 500ms
release v
endif
 
  IF Said("back",3)
press b
wait 400ms
release b
endif
 
A good idea to map the left and right feature, I'd been thinking of doing it too. The issue is how long do you tell the program to hold down the button, as that will dictate how long you look.

Here's my quick take on it, and the look back feature as well. The key C must on the keyboard be mapped to left in the game settings, V to look right, and B to rearview or look back.

Code:
 IF Said("left",3)
press c
wait 500ms
release c
endif
 
  IF Said("right",3)
press v
wait 500ms
release v
endif
 
  IF Said("back",3)
press b
wait 400ms
release b
endif

thanks a lot mate!!!! gonna try it out. cheers
 
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.
yes is possible, i mannage to have both voice and manual control of brake, fuel ecc with this lines: key.F1=Joystick.Button9
w= Joystick.Button5
s=Joystick.Button8
a=Joystick.Button7
d=Joystick.Button6
key.9=Joystick.Button3
key.8=Joystick.Button4
button5-button8 on my wheel (thrustmaster gt experience) are disposed in form of + ideal for quickmenu. For other wheel just modify the script with used button for the quickmenu.
 
This is awesome! Thank you for the suggestion Rob. I had some issues at the start that kept it from working....
I had to turn off "Noise Suppression" on my microphone. Also, when I first saved the custom pie file it did not place it in the VoiceScripts folder. Now it works fairly well.
Although, racing for Lotus I had to add ....

Code:
//MUTE CREW
IF Said("leave me alone, i know what i'm doing")
press key.Mute
wait 40ms
release key.Mute
endif
 
IF Said("talk to me")
press key.Mute
wait 40ms
release key.Mute
endif
 
Bryan, First confirm your mic is working. Next try opening your Word (or similar typing program) and test the software. If it's programmed to type a "L" when you say "look left", then you should see "L" being typed in your Word program.
 

Latest News

What's needed for simracing in 2024?

  • More games, period

  • Better graphics/visuals

  • Advanced physics and handling

  • More cars and tracks

  • AI improvements

  • AI engineering

  • Cross-platform play

  • New game Modes

  • Other, post your idea


Results are only viewable after voting.
Back
Top