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.”)
 
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.
Everything works, that's the strange part. I tested the mic with a recording program and could hear myself. Then I ran the script and opened Wordpad, but nothing happened. It doesn't need voice recognition software does it? Any solutions?
 
Just the common things:
Check the script for errors and don't forget to press 'run' button before testing.
Make sure that wordpad is actually 'on top' when you test by first typing something yourself.
Speech API is installed by default in Windows 7 as far as I know.
Maybe post your script here so we can check for errors too?
 
Script is fine I think, because it worked perfectly before my clean Windows 7 install, but here it is. Sorry for the long post:

//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 100ms //if game doesn't fully execute your voice commands, try making the wait times longer.
release w
wait 500ms
press w
wait 100ms
release w
wait 500ms
press w
wait 100ms
release w
endif

IF Said("mix two",3)
press w
wait 100ms
release w
wait 500ms
press w
wait 100ms
release w
wait 500ms
press d
wait 100ms
release d
endif

IF Said("mix one",3)
press w
wait 100ms
release w
wait 500ms
press w
wait 100ms
release w
wait 500ms
press key.s
wait 100ms
release key.s
endif

//TYRE CHOICES
IF Said("prime tyres",3)
press w
wait 100ms
release w
wait 500ms
press d
wait 100ms
release d
wait 500ms
press w
wait 100ms
release w
endif

IF Said("option tyres",3)
press w
wait 100ms
release w
wait 500ms
press d
wait 100ms
release d
wait 500ms
press d
wait 100ms
release d
endif

IF Said("intermediate tyres",3)
press w
wait 100ms
release w
wait 500ms
press d
wait 100ms
release d
wait 500ms
press key.S
wait 100ms
release key.S
endif

IF Said("wet tyres",3)
press w
wait 100ms
release w
wait 500ms
press d
wait 100ms
release d
wait 500ms
press a
wait 100ms
release a
endif

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

IF Said("Brakes neutral",3)
press w
wait 100ms
release w
wait 500ms
press key.S
wait 100ms
release key.S
wait 500ms
press d
wait 100ms
release d
endif

IF Said("Brakes rear",3)
press w
wait 100ms
release w
wait 500ms
press key.S
wait 100ms
release key.S
wait 500ms
press key.S
wait 100ms
release key.S
endif

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

//INSTANTLY RESTART TIME TRIAL HOTLAP
IF Said("restart time trial",3)
press key.Escape
wait 100ms
release keys.Escape
wait 500ms
press key.up
wait 100ms
release key.up
wait 500ms
press key.up
wait 100ms
release key.up
wait 500ms
press key.up
wait 100ms
release key.up
wait 500ms
press key.Enter
wait 100ms
release key.Enter
wait 500ms
Press key.Down
wait 100ms
release key.Down
wait 500ms
press key.Enter
wait 100ms
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.”)
 
Script seems to be fine. Can't see anything wrong with it.
For testing purposes, I'd recommend trying to get 'windows speech recognition' to work. Just do a few sentences to set it up, and see if that works. Maybe you need something extra somehow and that program will download it for you. Windows speech recognition will not work in F1 2012 so it's not a replacement for GlovePIE and the script, but it's just for testing.
 
That's a bit of a problem, because it sais that speech recognition isn't supported in the current language. My OS is Windows 7 Home Premium (Dutch) at the moment. But I wonder what I had on my pc before the cleanup that it worked..
Hi Bryan van Berl, I have had the same problem, the solution: change the display language in the control panel... and the talking orders must be in English... works perfect, could be needs set more ms (than 40ms) but is perfect. Must works...
Happy Christmas every body.....:D:roflmao:
 
As language, I can only choose English in GlovePIE.. Or do you mean in Windows?

Thanks, happy Christmas everyone as well!

EDIT: That sucks.. I can't change display language because I've got Home Premium (32 bit). I think I'm gonna install Ultimate (64 bit) and then try again.
 
Does anyone know how to turn the voice sensitivity down because when I'm talking the program is changing my tyres etc and sometimes quits the game LOL I don't want a push to talk as I use one for chatting
Microphone.PushToNotTalk = joystick.Button12
If you assign the same button as you use for chatting, the script should only execute when you're not talking on teamspeak or ingame.
 
Rob Mekkes thanks i'll set that but I also use Skype which I can't assign a wheel button :(

I don't really understand why it quits the session though because I don't have anything in the script to do that? I use you're script on page 1 but when I was in a league race the other day I was talking and the game menu popped up chose some options and quit to the main menu LOL
 
Rob Mekkes thanks i'll set that but I also use Skype which I can't assign a wheel button :(

I don't really understand why it quits the session though because I don't have anything in the script to do that? I use you're script on page 1 but when I was in a league race the other day I was talking and the game menu popped up chose some options and quit to the main menu LOL

You can also assign a button for GlovePIE, so the script only works if you press this button:
Microphone.Enabled = joystick.Button8

The script from page one has 'restart time trial' in it, which in fact is nothing more than moving through menus. I've had quite some 'false positives' myself, so eventually I started using the button to talk.

Also I went back to using buttons for fuel mix and brake bias, but I've kept the option open to use voice for it as well. Finally got the H-shifter on my G27 to good use :D My script now looks like this:

Code:
//GlovePIE script created by Chicane  december 18th 2012
 
//ACTIVATE AND IGNORE MICROPHONE OPTIONS
Microphone.Enabled = joystick.Button8
//Microphone.PushToNotTalk = joystick.Button12
 
//FUEL MIX CHOICES
IF Said("mix three",1) or joystick.button11
press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
wait 1000ms
endif
 
IF Said("mix two",1) or joystick.Button10
press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
wait 40ms
  press d
wait 40ms
release d
wait 1000ms
endif
 
IF Said("mix one",1) or joystick.Button9
press w
wait 40ms
release w
wait 40ms
  press w
wait 40ms
release w
wait 40ms
  press key.s
wait 40ms
release key.s
wait 1000ms
endif
 
//TYRE CHOICES
IF Said("prime tyres",1)
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",1)
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",1)
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",1)
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",1) or joystick.Button14
say "front"
press w
wait 40ms
release w
wait 40ms
  press key.S
wait 40ms
release key.S
wait 40ms
  press w
wait 40ms
release w
wait 1000ms
endif
 
IF Said("Brakes normal",1) or joystick.Button21
say "Neutral"
press w
wait 40ms
release w
wait 40ms
  press key.S
wait 40ms
release key.S
wait 40ms
  press d
wait 40ms
release d
wait 1000ms
endif
 
IF Said("Brakes rear",1) or joystick.Button23
say "rear"
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
wait 1000ms
endif
 
//CYCLE CAR STATUS
IF Said("Car status",3)
press joystick.Button12
wait 40ms
release joystick.button12
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
 
Glove Pie 0.45 also works fine on my system (Win 7-32 bit).

If you can't get the speech recognition to work, first activate "TroubleShooter", "Show Speech Recognition Progess" and test your speech commands. In case they are recognized but no keyboard commands will be sent (you can check this with notepad while script is running - just make shure notepad is in foreground), try the commands "key.mykey = true" and "key.mykey = false" instead of "press mykey" and "release mykey" (on my system they didn't work), e.g.:

Code:
IF Said("mix three",5)
key.w = true
wait 100 ms
key.w = false
wait 500 ms
elseif
 
Hi!
I have only 1 problem (left).
I cant "talk to my wheel buttons".
I assigned them in the game menu and written the script. All other keys on the keyboard works perfect.
How to find out the number of the button? Is it the same as in the game menu?

Anybody has the same problem?
Everything else works fine for me after installing an english version of windows.
 
Hi!
I have only 1 problem (left).
I cant "talk to my wheel buttons".
I assigned them in the game menu and written the script. All other keys on the keyboard works perfect.
How to find out the number of the button? Is it the same as in the game menu?
In case of Logitech G27, the numbers match with ingame. You can also find the button numbers in the logitech profiler. I think it's the same with Thrustmaster. Their software also shows the button numbers.
 

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