If you would like to generate some realistic battlefield sound atmosphere, i suggest you create your own soundsample, based on multiple tracks.
You can do this with audacity (there might be others around but with this i know it's possible to do.
First you would need a few single samples:
Machine gun fire (maybe a few different)
Single shots and/or burst mode salves
Grenades Explosion
Depending of the size of the battle even some tank grenades
In audacity you can now create your big sound file by randomly place some of the above samples into audacity. It isn't necessarly to have one track for each sample, they can be into the same track as long positions don't interfere.
Once the battle sounds as you like you can mix down your sample to a single stereo track and then export to a mono .ogg file.
With this it should be possible to run a simple script which loops the sample everytime it reaches the end, maybe make the loop 2 or 3 seconds shorter than the sound file so there wouldn't be a quiet phase.
Just a few things about the "mood", say realism: no soldier would fire endless salves since they don't have infinite ammo. Short breaks between gunfire is more realistic. You wouldn't waste your ammo if you have no target, do you?
Why do i endlessly talk about this, i'm pretty sure you know what you want to do ;D
Maybe just one little advice. before you begin your "ultimate war atmo sound file" begin first with a short one, let's say about 30 seconds, to see how things work. Once you've done with, save and forget it. Let it settle down for at least one day. Then open it and listen to it if you still like it. Whenever you work with sound, everything sounds exciting as long you're working on it. So let excitment settle down and listen to it with "fresh ears". Often you might think "Oh my good what did i think when i've done this".
Ok, a bit few words for a "little advice", but thrust me, i know what i'm talking about