Skip to content

DSP Voice Filters

Samuel De Oliveira edited this page Sep 30, 2026 · 4 revisions

DSP Voice Filters

The DSP Voice Filters module provides real-time Digital Signal Processing (DSP) applied to 16-bit 48kHz mono PCM audio before packet encoding across both Paper / Purpur and Fabric.

The module features a 100% file-first architecture:

  • Paper: plugins/DreamVoice/modules/filter/filters/
  • Fabric: config/dreamvoice/modules/filter/filters/

Filters can be added, updated, exported, or deleted on-the-fly without server restarts.


Built-In Filter Catalog

All 13 built-in filters are extracted to the filters folder on first startup:

Filter ID Effect Description Acoustic DSP Processing
alien Sci-fi extraterrestrial frequency modulation. Fast LFO ring-modulation with fractional-delay interpolation.
cave Cavernous natural acoustic reverberation. Multi-tap comb and all-pass delays with soft-limiting.
deep Deep demonic pitch downshift. 40ms Hann-windowed pitch grain downshifter (-4 semitones).
disguise Obscures vocal identity while maintaining intelligibility. Formant modulation with jitter and subtle ring modulation.
gasmask Heavy breathing restriction with physical enclosure resonance. Dual resonant band-pass with breathing noise gate.
ghost Ethereal floating spectral presence. Dual chorus delay lines with soft-knee limiting.
helium High-pitched cartoon voice. 40ms Hann-windowed pitch grain upshifter (+4 semitones).
megaphone Bullhorn / PA system projection. 2nd-order horn bandpass (600 Hz - 3400 Hz) with +5 dB resonance at 1.1 kHz.
muffled Speech obstructed by a wall or heavy fabric. 800 Hz Butterworth lowpass filter.
radio Walkie-talkie / CB radio transmission. 4th-order Butterworth bandpass (480 Hz - 2600 Hz), +4 dB presence boost at 1.5 kHz, $\tanh$ overdrive, and RF hiss.
robot Synthesizes a vocoder robotic monotone. Carrier synthesis ring-modulation normalized to $\le 1.0$.
telephone Vintage landline phone audio. 2nd-order bandpass (350 Hz - 3400 Hz) with asymmetrical carbon-capsule saturation.
underwater Submerged underwater muffled acoustics. Steep lowpass filtering (500 Hz) with low-frequency resonant boost.

File-First Filter Formats

The loader automatically detects and hot-loads filters from the modules/filter/filters/ directory:

1. Declarative Filters (.yml / .json)

Create custom DSP chains declaratively without writing Java code:

id: "vintage_radio"
priority: 50
enabled: true
pipeline:
  - type: "highpass"
    frequency: 400.0
  - type: "lowpass"
    frequency: 2800.0
  - type: "overdrive"
    gain: 2.2
  - type: "gain"
    multiplier: 1.1

Supported pipeline node types:

  • lowpass (frequency)
  • highpass (frequency)
  • gain (multiplier)
  • overdrive (gain)
  • ring_modulator (frequency, wetGain)
  • delay (delayMs, decay, wetGain)

2. Live Java Source Filters (.java)

Drop complete Java source files into modules/filter/filters/. DreamVoice automatically compiles them at runtime via the JDK JavaCompiler with custom in-memory classloading:

import fr.dreamin.dreamvoice.api.filter.model.VoiceFilter;
import java.util.UUID;

public class CustomBoostFilter implements VoiceFilter {
    @Override
    public String getId() {
        return "custom_boost";
    }

    @Override
    public int getPriority() {
        return 10;
    }

    @Override
    public short[] process(UUID playerUuid, short[] samples) {
        short[] out = new short[samples.length];
        for (int i = 0; i < samples.length; i++) {
            int val = (int) (samples[i] * 1.3f);
            out[i] = (short) Math.clamp(val, Short.MIN_VALUE, Short.MAX_VALUE);
        }
        return out;
    }
}

In-Game Commands

Command Permission Description
/voice filter list dreamvoice.voice.filter Lists all registered DSP voice filters and their source type.
/voice filter add <filter_id> [player] dreamvoice.voice.filter.apply Applies a voice filter to target player.
/voice filter remove <filter_id> [player] dreamvoice.voice.filter.apply Removes a filter from target player.
/voice filter clear [player] dreamvoice.voice.filter.apply Clears all active filters from target player.
/voice filter export <filter_id> <yml|json|java> dreamvoice.voice.filter.admin Exports any active filter to disk.
/voice filter reload dreamvoice.voice.filter.admin Hot-reloads all dynamic filter files from disk.

Java API & Integration (Paper & Fabric)

import fr.dreamin.dreamvoice.api.DreamVoiceAPI;
import fr.dreamin.dreamvoice.api.filter.service.VoiceFilterService;
import java.util.UUID;

VoiceFilterService filterService = DreamVoiceAPI.get().filterService();

// Apply a filter to player:
filterService.applyFilter(playerUuid, "robot");

// Check active filters:
boolean hasRadio = filterService.hasFilter(playerUuid, "radio");

// Remove filter:
filterService.removeFilter(playerUuid, "robot");

Inter-Mod & Network Integration (Fabric)

On Fabric servers, client mods (e.g. voice HUD, helmet/gasmask wearable mods) can apply or toggle filters via packets:

  • ServerBoundFilterApplyPacket
  • ServerBoundFilterRemovePacket
  • ServerBoundFilterClearPacket
  • ServerBoundFilterTogglePacket
  • ClientBoundFilterSyncPacket

For packet details, see Network Packets & Protocols.

Clone this wiki locally