Audio in Firefox: "sourceNode" is null

I’m currently developing a game that is starting to use some audio, but it only works partially in Firefox.

It seems that randomly during playback, the “sourceNode” in the audio engine sometimes becomes null for whatever reason (this is not necessarily triggered by my code, I noticed that it sometimes also happens when I switch tabs).

I don’t know CCAudio.js at all so I can’t effectively debug it. However, I’ve uploaded a debug version of the game I’m working on so you can wait for the error to happen and maybe find out what’s causing it. It’s up here:

https://cocos.testbed.dev.pitforest.de/

It is not minified, so you can debug it. All audio-related magic happens in “src/systems/audiosystem.js”.

Just click “go farming” on the top left, the lil dude will go to the farm map and kill some monsters. You can click on “view farm map” to observe this. While they fight, they will make some placeholder noise. This works for a while, but with the latest firefox version the “sourceNode is null” error consistently pops up after the raider has killed one or two of the monsters.

The uploaded version runs on Cocos2d-JS 3.3, but I’ve tried & confirmed that it happens in 3.5 as well. The bug does not at all occur on Chrome. In IE, well, IE doesn’t support wavs so currently I hear nothing, but I will solve that with transcoding the audio to another format in the future.

Also you’ll note that during loading the engine seems to try and load a lot of alternative files (the sounds are in .wav, and the engine tries to load .mp3, .m4a, etc., but nevertheless audio playback seems to work, at least for a while).

I’m testing this on Win7 64 bit, no dedicated sound hardware. But the error happens in Win8 64 bit as well.

@VisualSJ Please confirm this issue