Skip to content

Rundown: Web Audio API effects feasibility for LittleJS#170

Draft
Copilot wants to merge 1 commit into
mainfrom
copilot/hook-up-audio-effects
Draft

Rundown: Web Audio API effects feasibility for LittleJS#170
Copilot wants to merge 1 commit into
mainfrom
copilot/hook-up-audio-effects

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 24, 2026

The issue asks to investigate hooking up audio effects (reverb, filter, etc.) via the Web Audio API. This is a research/analysis pass — no code changes yet.

Current signal chain

AudioBufferSourceNode → StereoPannerNode → GainNode (per-sound) → audioMasterGain → destination

audioContext and audioMasterGain are already public, so insertion points exist at both master and per-sound level.

Feasible additions

Master bus (global, affects all sounds)

  • DynamicsCompressorNode — prevents clipping; near-zero config; strong candidate for core
  • BiquadFilterNode — LPF/HPF for "muffled" effects (underwater, wall, etc.)
  • ConvolverNode — room reverb via impulse response (file-based or synthetically generated)

Per-sound (on individual SoundInstance)

  • BiquadFilterNode — per-sound EQ (telephone voice, muffled footstep)
  • DelayNode + feedback — echo/slap-back
  • WaveShaperNode — distortion/overdrive
  • PannerNode (3D) — upgrade from flat StereoPannerNode; adds distance model, cone, orientation

Utilities

  • Synthetic reverb IR generator (exponential noise decay — no audio file needed)
  • connectMasterEffect(node) escape hatch for custom Web Audio graphs

Proposed placement

Scope Location
Master compressor / filter / reverb src/engineAudio.js, wired in audioInit() with setter functions
Per-sound filter / delay Sound class, optional param or method
Optional/complex effects New plugins/audioEffects.js

Master DynamicsCompressorNode is small enough to belong in core. Everything else is a clean fit for a plugin.

Copilot AI linked an issue May 24, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Hook up audio effects like reverb and filter Rundown: Web Audio API effects feasibility for LittleJS May 24, 2026
Copilot AI requested a review from KilledByAPixel May 24, 2026 06:56
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.

Hook up audio effects

2 participants