Commit graph

4 commits

Author SHA1 Message Date
tryptz
8c9a613bee fix: resolve remaining PR #523 review issues
Guard generateFrequencies against bandCount=1 division by zero, fix
inverted HRTF ITD delays for left-side sources, remove unused variable,
promote _interpolateGains to public API, and add NaN guard to widening.
2026-04-10 16:06:04 +03:00
tryptz
79313e7a0a fix: address PR #523 review comments for EQ and binaural DSP
- Remove stale IIR coefficient JSDoc comment
- Reset M/S channel state on EQ import to prevent stale assignments
- Enforce strictly increasing GEQ frequencies to prevent rounding duplicates
- Guard Q calculation against zero octave spacing (Infinity/NaN)
- Export EQ from stored metadata instead of live BiquadFilterNode state
- Accept .csv in legacy GEQ import file input
- Expose public reconnect() on BinauralDSP instead of calling _connectInternal
- Dispatch binaural-mode-changed on channel count change, not just mode change
- Remove no-op channelCount/channelCountMode on MediaElementAudioSourceNode
- Add void to floating promises (toggleBinaural, notifyBinauralChannelCount, _loadBinauralSettings)
- Wrap binauralDspSettings._setAll in try/catch for QuotaExceededError
- Make generateHRTF synchronous (no awaits, was misleadingly async)
2026-04-10 16:06:04 +03:00
tryptz
ab23c3e64e style: auto-fix linting issues 2026-04-10 16:06:04 +03:00
tryptz
5bbc36cdb1 feat: add binaural/spatial DSP with multichannel HRTF rendering
Implement a complete binaural audio processing pipeline that sits before
EQ Studio in the signal chain. Supports multichannel (5.1) HRTF
binauralization for Dolby Atmos and Apple 3D Audio content, with
crossfeed and stereo widening for regular stereo content.

New modules:
- hrtf-generator.js: Procedural HRTF impulse response synthesis using
  Woodworth head model (ITD, ILD, head shadow, pinna coloring)
- binaural-dsp.js: BinauralDSP engine with multichannel splitter,
  per-channel ConvolverNode HRTF rendering, Bauer-style crossfeed
  (low/medium/high), and M/S stereo widener

Integration:
- Audio graph: binaural block inserted before preamp/EQ, multichannel
  passthrough via MediaElementSource channelCount=6
- Storage: binauralDspSettings with full persistence (JSON in localStorage)
- UI: toggle + sub-controls (crossfeed level, HRTF preset, width slider)
  placed before EQ Studio in settings
- Player: auto-enables binaural DSP when Atmos content detected,
  shows binaural badge on Atmos tracks
2026-04-10 16:06:04 +03:00