Muffled Audio/In game deafness

Also, I had a thought today that one work-around would be to surround the entire level with an AudioVolume and set interior LPF to something low, however, that’s only if the player is on the outside of the volume and the sounds are on the inside of the volume, and since it surrounds the whole level, the player would on the inside of the volume with the audio source, so no filters would apply.

Which got me thinking that maybe I should check out the AudioVolume.h and cpp files and see what trickery and magic is happening in here, but so far, due to my limited knowledge in C++ programming, I am struggling to find out exactly what causes the muffled audio.

I feel like Fmod or Wwise and other plugins aren’t necessary to do this, since the engine is capable of muffling audio on it’s own, but I guess some custom code needs to be created in order for it to happen. I just need to find out what code it is that causes the muffling, and re-purpose that code to be able to do it dynamically, on a key press if need be.

UPDATE:
I dug a little deeper and found a this little snippet of code inside of the ActiveSound.cpp file:



void FActiveSound::HandleInteriorVolumes( const FListener& Listener, FSoundParseParameters& ParseParams )
{
//SNIP

		CurrentInteriorLPF = FMath::Lerp(SourceInteriorLPF, MAX_FILTER_FREQUENCY, Listener.InteriorLPFInterp);
		ParseParams.AmbientZoneFilterFrequency = CurrentInteriorLPF;



I want to change the code to this, purely for the sake of testing. I presume this would mean that even if the the player (listener) and audio source are inside of an audio volume, that instead of doing a LERP to the MAX_FILTER_FREQUENCY, it would instead LERP to whatever the InteriorSettings Exterior LPF is using the alpha which is the listeners interior LPF Interp value.
So…it should, in my limited knowledge of C++ do a LERP from the max filter frequency (which I believe is 20000) to whatever I specify to be the interior LPF of the volume (e.g. 20).
I’m probably wrong, very wrong, but looks right to me :stuck_out_tongue:



void FActiveSound::HandleInteriorVolumes( const FListener& Listener, FSoundParseParameters& ParseParams )
{
//SNIP

		CurrentInteriorLPF = FMath::Lerp(MAX_FILTER_FREQUENCY, SourceInteriorLPF, Listener.InteriorLPFInterp);
		ParseParams.AmbientZoneFilterFrequency = CurrentInteriorLPF;


My problem is that I can’t test this, as I am not sure how I can modify the source files and have it update in the editor. Even if I completely delete the ActiveSound.cpp file, it doesn’t seem to have any problems, it’s as if it’s not really being read. But it’s my lack of knowledge here that is letting me down, so how would I go about modifying source files and having them update in the editor much the same way as if I was creating my own custom C++ classes?