Detecting when in driver control

Is there a system variable or something that goes true when the system is in driver control mode? I would like to make a program that plays a sound on the speaker when time is running out to help our team get in tune with perfroming on the field.

you can use the variable bIfiAutonomousMode, this will be true when running in autonomous and false when in driver control. You can also use the variable bIfiRobotDisabled to test the enabled/disabled state and, for advanced use, the variable nVexRCReceiveState which has information about whether the competition switch and controllers are connected.