Skip to content

Feature: Per-segment audio effects DSP preset selector for dub pipeline #67

@4shil

Description

@4shil

Problem

The dub pipeline currently has no way to customize audio treatment per segment. All segments use the same mastering chain (apply_mastering with fixed highpass + compressor + reverb). Different scenes benefit from different audio treatment: podcast dialogue needs heavy compression, action scenes need presence boosts, cinematic scenes need reverb.

Proposed Solution

Add a per-segment effect_preset field to DubSegment that lets users choose from 6 broadcast-grade DSP presets (broadcast, cinematic, podcast, warm, bright, raw). This leverages existing, well-tested code in audio_dsp.py (apply_effects_chain, EFFECT_PRESETS, list_effect_presets()) that was previously only used in standalone TTS generation.

Scope

  • Backend API + Frontend state management only (no UI component in this PR)
  • Non-breaking: defaults to broadcast preset, existing behavior unchanged
  • No database schema changes
  • No model changes

Files Changed

  • backend/api/routers/engines.py — new GET /engines/effects/presets route
  • backend/api/schemas.pyEffectPresetEntry + EffectPresetsResponse
  • backend/schemas/requests.pyeffect_preset field + Pydantic validator on DubSegment
  • backend/api/routers/dub_generate.py — apply effect chain in TTS hot loop
  • backend/services/batched_tts.py — apply effect chain in batch TTS; effect_preset in SegmentSpec
  • backend/api/routers/generation.pyeffect_preset form field in standalone /generate
  • backend/services/incremental.pyeffect_preset in fingerprint fields
  • frontend/src/api/engines.tsEffectPreset type + fetchEffectPresets()
  • frontend/src/api/types.tsDubSegment type with effect_preset
  • frontend/src/store/dubSlice.tssegmentEffectPresets state + actions
  • tests/test_effects_chain.py — 12 unit tests (pure functions, no GPU)

Verification

uv run pytest tests/test_effects_chain.py -v

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions