Full Auto Gun Sound

When making a shooter, single fire or semi auto is simple. For the sounds stopping and restarting the current shot sound or using PlayOneShot is good enough sound and performance wise. But full auto is different.

Take battlefield or halo for instance. Especially the SAW which has a very high ROF. What would be the best approach for making it sound realistic as well as good performance?
I would think that using an audio loop instead of individual fire sounds would be the best way, but then you have to account for the decay after your last shot.

Adding a tail audio clip could help but it would all come down to timing to make it sound just right if you could even pull that off. If you pull off the trigger right in the middle of a shot sound in the loop, you would hear it cut off immediately and a tail sound that may not fit right with the position in the audio you stopped at would play and just sound weird.

Flip the coin over, if we use the same method for single shots with full auto and using stop and restart, that wouldn’t sound good because we’d hear each sound stop prematurely. Using PlayOneShot works perfectly if not for the performance degradation with multiple high ROF weapons - not to mention the cut out of sounds when you get too many playing at once.

Bit of a head scratcher here for me. I need to figure out how to do this and make it sound good as well as be performance friendly. I know there has to be a way. After all, Halo, COD, Battlefield, and pretty much every shooter game has made this work. It’s gotta be longer audio loops, I’m sure of it. I just have no idea how to make it work???

Also, why is StrangeLoc the only topic I can post under?

Thanks

So I know this isnt much of an answer but I read this whole article and it is very interesting.

Here’s the article: The Article

Summary:
I think what he is trying to say is to truly give a gun a full auto feel you have to have 3 different recordings. One for when the player is just holding down the fire button, the very start of the firing and the very end of the firing. I am going to link all of the sound files so you can better understand what I mean because this idea is very good and I recommend you giving it a good shot.

Audio Files:
StartShotSound
FullAutoRepeatSound
EndingShotSound

Hope this helps a bit.

I don’t really know if that’s performance friendly, but you could try instantiating and audio source for every shot and remove it after 2-3 seconds. This way the shots don’t get cut off and there is no need to create a new audio file. Object pooling using audio sources might also be possible

What I did for my game, instead of “Input.GetMouseButton(0)”, I used “Input.GetMouseButtonDown(0)” to play my looped Audiosource audio(source.Play) and Input.GetMouseButtonUp(0) to stop it(source.Stop), it sounds unnatural and abrupt, so I added sound fade in and out functions, basically lerping between source max volume and no volume