The time lag between playing and the sound coming back out is called Latency — it is the time required for you interface to digitize the sound, buffer it, the computer to read the buffer, process it, write the results back to the buffer, the interface to read the buffer, and finally to convert it back to analog for you to hear it.
You can never completely eliminate latency, but you can bring it down to livable delay times.
To adjust latency, you need to choose a good quality driver for the sound interface, then change the buffer size. It is also dependent on having a good quality audio interface card. If you are using onboard audio or a basic Soundblaster card, you’ll have fewer options.
Look up the manuals of your audio interface and recording software for detailed instructions.
First of all, go into the Audio settings or Preferences of the software, and choose the ASIO driver for your interface (not the WDM or other driver)
Make sure your audio software and interface drivers are up to date. If your sound interface did not come with an ASIO driver, try asio4all http://www.asio4all.com/
Then change the buffer size. It is expressed in bytes, you probably have it set to 1024 or more. Reduce this to 128 or less. You’re shooting for a latency of 20 ms. or less, which should be tolerable as a lag time to your playing.
The trade off us that when you reduce the buffer, you reduce latency (because it takes less time to fill the buffer) but you increase the chance that your computer processor won’t be able to keep up, and you may get audible glitching in your audio. You need to strike a balance between audio consistency and latency.
You can try reducing the amount of things you are asking the computer to do at the same time — turn off all unneeded programs, use only the minimum EQ, compression, instruments and effects software while recording (you can add them later in processing the track or mixing), minimize the number of audio tracks you have playing as you are recording. Do you really need to have the whole set of orchestra tracks playing as you sing, or can you get away with a barebones backing track? If you do have to have a complex track playing with effects and software instruments, consider ‘freezing’ a mixdown of those tracks to a stereo audio ‘scratch’ track for playback, and then turn off all the individual effects and instrument tracks. Frozen audio tracks take way fewer resources to play back.
If you have selectable bit rates and bit depth for recording, then reducing the rate and depth will reduce latency problems. 16 bit / 44.1 KHz sampling is way easier for the computer to process than 24 / 96, so you can reduce the buffer size.
The other thing you can do is to reduce the buffer size while you are recording live, and the increase the buffer again for when you are mixing or working ‘inside the box’. Latency doesn’t cause any problems when you are purely playing back tracks or mixing down.
The ultimate way to reduce latency is to get a faster computer and higher quality audio interface
You can take a headphone monitor of the instrument you are recording before it enters the audio interface (and some interfaces have a ‘zero latency’ monitoring output). By splitting the signal in analog, before it gets digitized, you won’t have any latency in hearing your playing. Granted, you also won’t hear any of the effects or EQ that the computer recording software is applying to the sound, but you should be able to hear well enough to lay down the track. If you need to, apply some effects to your live monitor signal outside of the computer to give you a basic idea of how it will turn out. This is where a flexible mixer comes in handy.
Lastly, if you are relying on the computer to supply the effects, distortion, compression and EQ on your guitar or instrument sound, consider using outboard hardware effects to create the sound before recording it. You will lose some flexibility in modifying the sound later, but the load on the computer will be lessened greatly. Look at amp simulation and effects boxes from Line6, Johnson, Boss, Digitech, Korg and others. A bonus to this is that you can monitor the analog signal while you are playing, with no latency. If your track ends up out of time with the computer tracks, no problem, you can shift it forward or back on the timeline, or apply the software’s latency compensation features to line it up again.