Added Graphic EQ and Compressor#1972
Conversation
importing EqSettings as EqSettingsType
Forgot to change a line so its been fixed now
same test as main branch
added --fix to lint to auto-sort and fix minor errors.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
kgarner7
left a comment
There was a problem hiding this comment.
See required changes. Note that I will not approve this unless it is also supported for web player (the most common player).
oopsie
shouldnt have this in here anyways. Already a lint test action exists. Was just using it do demo a flag
|
Working on adding Web player functionality. I will request another review when appropriate |
Extends the existing EQ and compressor feature (previously MPV-only) to also work with the Web Audio player backend. Changes: - types.ts: extend WebAudio type with optional dsp field containing preampGain (GainNode), eqFilters (BiquadFilterNode[]), and compressor (DynamicsCompressorNode) - audio-players.tsx: build Web Audio DSP chain on AudioContext creation, inserting preamp, peaking EQ filters, and DynamicsCompressorNode between the existing gain nodes and context.destination; nodes are initialised from persisted settings so filters are active immediately on first playback without requiring the settings panel to be opened - eq-settings.tsx: applyFilters now branches on player type; MPV path unchanged (lavfi filters via IPC), Web Audio path updates AudioParam values directly on the live DSP nodes for glitch-free real-time adjustment; EQ and compressor panels are now visible and functional for both player backends; subtitle labels updated to reflect the active backend
…ation - Fix perfectionist/sort-imports ordering in audio-players.tsx and eq-settings.tsx - Fix perfectionist/sort-objects: move compressor before equalizer in dsp object - Fix perfectionist/sort-union-types: move null before object type in WebAudio dsp field - Fix react-hooks/immutability: access WebAudioContext directly via useContext instead of reading dsp nodes from useWebAudio hook return value, which was incorrectly flagged as a hook-return mutation - Fix prettier formatting throughout applyFilters callback
|
Added Web player EQ |
|
Thanks! The web audio implementation actually works really well. It looks like for MPV, the ranges have too high of a collision, tested by just turning up all the knobs to +12. In web audio, this just makes the whole thing loud, but with MPV the audio is very distorted. |
|
I'll do some investigating and see what I can do about the clipping but I suspect there won't be much as clipping is expected and the same thing happens with VLC and other players that use the FFMPEG backend |
Distortion occurred when boosting EQ bands in the MPV player because FFmpeg's equalizer lavfi filter has no built-in gain limiting signal values exceeding 0 dBFS were hard clipped at the integer conversion stage in MPV's audio output pipeline. Fix: prepend a volume filter before the EQ band chain with a compensated gain value calculated as (preamp - maxBandBoost), where maxBandBoost is the highest positive band gain across all active bands. This ensures the input signal always has sufficient headroom to accommodate the largest band boost without clipping. Preamp behaviour is now consistent with hardware EQs and VLC: - Positive preamp raises the pre-EQ input level and is visible to the user when bands are flat - Negative preamp adds additional headroom on top of auto-protection - Auto-protection is proportional to the largest band boost only, not additive with the preamp value (previous implementation incorrectly included preamp in totalBoost, causing positive preamp values to be fully cancelled by the compensation) This limitation does not affect the Web Audio player, which processes audio entirely in 64-bit float with no integer conversion between nodes and therefore cannot hard clip at intermediate stages.
I pushed some updates to fix the EQ on MPV to prevent distortion. Its consistent with how VLC handles EQ and Compression. Feature should now be complete unless bugs are found. |
|
Thanks. Last two points (although you'll have to ask @jeffvli to help review those):
|
|
I've changed the behaviour of the preamp
This should be fixed now. I cant seem to replicate your issue with the EQ not being auto applied? Check the new version and let me know |
|
Could you refactor the EQ settings component and anywhere else that you're using custom inputs to use the existing components instead? This includes the VerticalSlider, HSlider, and Toggle components that already have existing wrapped components available. You will need to rebase development onto your branch as the newly commited Mantine v9 upgrade now includes vertical sliders natively. Using your custom components means that they do not follow the existing app theme. |
Uses MPV playback. 12 Band EQ and a simple Compressor with some basic presets.