Closed FrancisTR closed 1 year ago
Doubled game audio doesn't occur on Firefox and LibreWolf (very similar to Firefox) for some reason. On Brave (Chromium-based browser), doubled audio is always present on the main menu. And before clicking Start on any difficulty, it's also doubled. The doubled music can be seen visually on the preview too. After clicking Start, no doubling music anymore.
Doubled game audio doesn't occur on Firefox and LibreWolf (very similar to Firefox) for some reason. On Brave (Chromium-based browser), doubled audio is always present on the main menu. And before clicking Start on any difficulty, it's also doubled. The doubled music can be seen visually on the preview too. After clicking Start, no doubling music anymore.
Is it caused by the order of the code in the JS file? If so, how would we approach to fixing it?
This is what it looks like when you first boot up the game.
After playing a level (win or lose), the line is bolded. This indicates that the audio is playing twice at the same time.
The issue on Brave browser seems somewhat different. It's not bold, there's two audios playing with a slight delay and it's visible on the oscillator. No bold line on any difficulty I tried that also.
After some searching, I saw two GitHub issues on p5.js-sound repository which might be related:
No simple solution I can find yet.
Probably won't work, but just in case another link I found: p5.sound.js with glitchiness fix
@FrostyNick I found the issue. It seems to fix itself every time I resize my window. During the resizing, it calls "setup();" every time the window size changes. The solution is to call "setup();" on the switch case "0", which is in the main menu. Going to include that solution in my PR coming this week.
@FrostyNick I found the issue. It seems to fix itself every time I resize my window. During the resizing, it calls "setup();" every time the window size changes. The solution is to call "setup();" on the switch case "0", which is in the main menu. Going to include that solution in my PR coming this week.
It seems that it works in FireFox, but not in Google Chrome. This issue still remains until otherwise.
It is now fixed.
The issue on Brave browser seems somewhat different. It's not bold, there's two audios playing with a slight delay and it's visible on the oscillator. No bold line on any difficulty I tried that also. Brave (always has doubled sound) LibreWolf (no audio issues)
This issue persists as of the newest commit c097aab in PR for alpha v1.0.0; at least for Brave browser. This could be be the same issue as in Microsoft Edge (#47) since both are Chromium-based browsers.
It seems that the audio is not loud at first but when you play any level and return to the main menu (Regardless if you win or lose), the audio 'doubles' itself such that two of the same audio is playing at once.