Skip to content

Conversation

@ACrazyTown
Copy link

@ACrazyTown ACrazyTown commented Apr 5, 2025

This is an attempt to make the analyser volume-independent on web for parity across desktop and web.

compressed.mp4

Instead of attaching the AnalyserNode directly to the howler gain node, we can check if there's a buffer source node available. If it is, we can "hijack" it and attach our analyser to it directly, allowing us to get audio data straight from the source without any volume changes. If the buffer source node isn't available, we can simply fallback to the old method and attach the analyser to the gain node.

I'm not sure how safe it is to mess with the nodes like this but from my brief testing I haven't encountered any issues. One quirk of this is that now analysers have to be cleaned up with analyser.cleanup() otherwise there might be duplicate event listeners on the sound which may break things. (will be resolved in Funkin' with FunkinCrew/Funkin#4579)

ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Apr 5, 2025
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Apr 5, 2025
charlesisfeline pushed a commit to charlesmilkjug/Funkin2 that referenced this pull request Apr 5, 2025
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Apr 30, 2025
Hundrec pushed a commit to ACrazyTown/Funkin that referenced this pull request Aug 15, 2025
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Dec 13, 2025
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Dec 13, 2025
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Jan 14, 2026
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Jan 14, 2026
ACrazyTown added a commit to ACrazyTown/Funkin that referenced this pull request Jan 14, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant