[SOLVED] TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite


I am started to face this issue today randomly with my project.

It sometimes happen when clicking on button where sound is played. Sometimes upon changing scene.

Uncaught TypeError: Failed to set the 'value' property on 'AudioParam': The provided float value is non-finite.
    at SoundInstance3d.set (instance.js:501:33)
    at SoundInstance3d._playAudioImmediate (instance.js:677:20)
    at SoundInstance3d.play (instance.js:635:14)
    at SoundSlot.play (slot.js:201:22)
    at SoundComponent.onEnable (component.js:323:22)
    at SoundComponent.set (component.js:301:18)
    at SoundComponentSystem.initializeComponentData (system.js:91:41)
    at SoundComponentSystem.addComponent (system.js:53:14)
    at SceneParser._openComponentData (scene.js:107:24)
    at SceneParser._openComponentData (scene.js:116:36)

Any suggestion will be helpful.

try putting a breakpoint on that top line with condition !isFinite(value) - that should stop the execution when invalid value is passed in. That’d be a good starting point to see what’s up.

1 Like

Usually it means the camera is set to some invalid position, like undefined or nan. The consequence will be that audio param will crash, as it depends on camera location. Just check the values of where you are setting position to some entity. Maybe camera entity is no longer available when the sound is played?



@mvaligursky Yes i added crosscheck accordingly and it seems working without error.

@LeXXik Thanks for pointing out the problem i disabled sound for now to avoid this issue when changing scene, and it seems work.

Thank you both of you for pointing out problem and giving most accurate solution. :slightly_smiling_face: :+1: