'Lower Quality' or 'bass only' version of sound from far away (~500 meters)

I have a turret in my game that shoots really loud, and it sounds amazing. I want to know what I can do to make it “transition” between the two depending on distance. So if the user is 500m+, it will play the 'bassier, quieter, far sounding version. If the user is 400m, it will play the quiet one at like 70% and the cool one at 30% or whatever. I hope you understand what I mean. Anyone know how I can do this?

Just in case nobody knows, I just have a speculated answer a “point you in the right direction” answer.

I know in Call of Duty and Fallout for example they use a seprate sound file that is lower and sounds in the distance. Like 1st person view and 3rd person view sound. (Not sure how to tweak the distance though.)

When I modded fallout in the GECK it showed 2 seperate files.

On the Unity engine idk how it works yet, but you can research tutorials and search fallout forums like this on how to add custom gun sounds.

Something like this should work - though you’ll want to replace PlayClipAtPoint with a permanent AudioSource as the temporary ones will be silent at this distance. I’m not sure but I think you could call PlayOneShot twice and it will play both simultaneously.

float distanceThreshold = 500f;
float d = Vector3.Distance(transform.position, turret.position) / distanceThreshold;
float nearVol = Mathf.Max(1f - d, 0f);
float farVol = Mathf.Min(d, 1f);

if(nearVol > 0){
    AudioSource.PlayClipAtPoint(nearGunshot, turret.position, nearVol);
}
if(farVol > 0){
    AudioSource.PlayClipAtPoint(farGunshot, turret.position, farVol);
}

Basically, dividing the distance from you and the turret by the distance you want to be 100% far gunshot (or ‘threshold’). Any distance between 0 and the threshold will be a value between 0 and 1. If you are 75% to the threshold, the value will be 0.75. The near volume should be 25% at that point, so 1 - 0.75 = 0.25. If it’s greater than or equal to the threshold it should be 0 (1 minus anything over 1 will be limited to 0). The far volume can just be the result of the division, 25% to the threshold will be 25% volume, anything at or past the threshold will be maximum volume. I think the audio source’s volume is automatically limited between 0 & 1 so you could probably remove the Min and Max methods and just use d instead of farVol but I wrote them anyways. Hopefully this is what you meant!