Frequency-Based Sound Attenuation Script

A problem I haven’t fixed yet is how it uses the player’s head for calculations, but their camera picks up the sound. Ideally, the camera should be the focus point of the calculations instead because it would be more realistic that way.