From a12b726648c65a749121ce965fe9fbde18ccc798 Mon Sep 17 00:00:00 2001 From: Marcin Macierzanka Date: Fri, 11 Sep 2026 01:54:42 +0200 Subject: [PATCH] feat: add player audio effects module with real-time pipeline, distortion, fourth density, and UI controls --- frontend/src/api/client.ts | 5 + frontend/src/components/PlayerPanel.vue | 170 ++++++++++++------ frontend/src/types/status.ts | 12 ++ tests/test_api_surface.py | 1 + tests/test_effects.py | 75 ++++++++ zyrarbot/audio/effects/__init__.py | 24 +++ zyrarbot/audio/effects/base.py | 22 +++ zyrarbot/audio/effects/distortion.py | 30 ++++ zyrarbot/audio/effects/fourth_density.py | 87 +++++++++ zyrarbot/audio/effects/muffled.py | 44 +++++ zyrarbot/audio/effects/pipeline.py | 75 ++++++++ zyrarbot/audio/effects/registry.py | 35 ++++ zyrarbot/audio/effects/tremolo.py | 44 +++++ zyrarbot/audio/ytdl_source.py | 32 ++-- zyrarbot/music/guild_music_state.py | 19 +- zyrarbot/music/music_player.py | 31 +++- .../ui/api/requests/effect_toggle_request.py | 8 + zyrarbot/ui/api/routers/playback_router.py | 22 +++ zyrarbot/ui/api/status_service.py | 8 + zyrarbot/ui/bot/cogs/control_cog.py | 24 +++ 20 files changed, 698 insertions(+), 70 deletions(-) create mode 100644 tests/test_effects.py create mode 100644 zyrarbot/audio/effects/__init__.py create mode 100644 zyrarbot/audio/effects/base.py create mode 100644 zyrarbot/audio/effects/distortion.py create mode 100644 zyrarbot/audio/effects/fourth_density.py create mode 100644 zyrarbot/audio/effects/muffled.py create mode 100644 zyrarbot/audio/effects/pipeline.py create mode 100644 zyrarbot/audio/effects/registry.py create mode 100644 zyrarbot/audio/effects/tremolo.py create mode 100644 zyrarbot/ui/api/requests/effect_toggle_request.py diff --git a/frontend/src/api/client.ts b/frontend/src/api/client.ts index 609727f..38047b0 100644 --- a/frontend/src/api/client.ts +++ b/frontend/src/api/client.ts @@ -57,6 +57,11 @@ export const api = { setVolume: (volume: number) => post('/api/volume', { volume }), setVolumeBoost: (enabled?: boolean) => post<{ status: string; volume_boost: boolean }>('/api/volume_boost', { enabled }), + toggleEffect: (effectId: string, enabled?: boolean) => + post<{ status: string; effect_id: string; active: boolean; active_effects: string[] }>( + '/api/effects/toggle', + { effect_id: effectId, enabled }, + ), cycleLoop: () => post<{ mode: 'off' | 'playlist' | 'single' }>('/api/loop_cycle'), jump: (index: number) => post('/api/jump', { index }), diff --git a/frontend/src/components/PlayerPanel.vue b/frontend/src/components/PlayerPanel.vue index 66c7e48..17d3922 100644 --- a/frontend/src/components/PlayerPanel.vue +++ b/frontend/src/components/PlayerPanel.vue @@ -1,6 +1,7 @@