[Acoustic Simulation] Under certain conditions, audio breaks everywhere forever

While creating a dynamic rain system I came across a strange bug, I can’t explain why it happens, but I assume it has to do with rotated parts

When camera get closer to “tent”, this bug occurs


Expected behavior

Audio will still play sounds effects


Repo file in private message

A private message is associated with this bug report

Thanks for the report; will check out the placefile

Hey @NOTEKAMI – it looks like the MaterialAudio script can end up positioning some parts that have AudioEmitters at suuuuuuuuuper far away positions; I added this line as a diagnostic

		if AudioEmitterPart.Position.Y < -1000000000000 then
			print("Woah")
		end

and it fires whenever I place my camera near the tent, just like you said.

When this happens, some calculations inside the audio engine end up generating infinity or NaN, which corrupts a lot of other math as a result, and all audio goes silent :skull:

We’re going to patch our code to make it more robust against this, but you may also be able to work around it by clamping the positions of those AudioEmitterParts

8 Likes

I decided to check what I get when using workspace:Blockcast() and I sometimes get NaN, but all the data I pass looks normal, does this means that this is also an engine bug?

Edit:

Filled a bug report for this.

Thanks for filing that – yeah it might be a separate/additional issue

Hey @NOTEKAMI – we added extra checks to prevent NaNs from getting into acoustic simulation; does this resolve the problem on your end?

Hey, now the audio doesn’t break when receiving NaN!
But unfortunately the main problem with Blockcast (Shapecast and Spherecast i belive too) still returns NaN under certain conditions

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.