Skip to content

solved 68#71

Merged
FOSSCLUB-LBSITW merged 1 commit into
FOSSCLUB-LBSITW:mainfrom
annrose2277-glitch:supreme
Mar 13, 2026
Merged

solved 68#71
FOSSCLUB-LBSITW merged 1 commit into
FOSSCLUB-LBSITW:mainfrom
annrose2277-glitch:supreme

Conversation

@annrose2277-glitch
Copy link
Copy Markdown
Contributor

📌 Description

Brief description of what this PR does.


🔗 Related Issue

Closes: #68


🛠 Changes Made

  • I have fixed the audio clipping and DOMException issues in script.js by implementing an audio cloning strategy in the playSound()
    function. Instead of resetting and reusing a single audio node, the function now creates a cloneNode() for each play request. This
    allows sounds like the bird's flap to overlap naturally (polyphony) and avoids the browser errors caused by interrupting a playing
    track. I also included a cleanup mechanism using the onended event to remove finished clones from memory and slightly reduced the volume
    of these clones to prevent audio distortion when multiple sounds layer.

📷 Screenshots (if applicable)


✅ Checklist

  • [yes ] I have tested my changes
  • [yes ] My code follows project guidelines
  • [yes ] I have linked the related issue

@FOSSCLUB-LBSITW FOSSCLUB-LBSITW merged commit 01cabeb into FOSSCLUB-LBSITW:main Mar 13, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Audio Clipping and DOM Exceptions

2 participants