Skip to content

Custom Audio Processing

Lets your AI assistant build and run a processing chain on any audio file. You describe what you want (“cut the low end, add some compression, limit to -1 dBTP”) and the assistant translates that into a list of operations that Phantom executes in sequence.

Requires the phantom-audio[processing] extra. Add it with: uv tool install "phantom-audio[processing]" --python 3.13 --force

Parameters

Parameter Type Default Description
file_path string required Path to input audio file
operations list[dict] required Ordered list of processing operations. Each operation is a dictionary with a "type" key and type-specific parameters.
output_path string required Where to write the processed file. Must sit inside Phantom's output directory (~/.phantom/output by default, or PHANTOM_OUTPUT_DIR). Paths outside it are rejected.

Supported Operations

Each operation is a dict with a type key. The type names are Pedalboard plugin class names and are matched exactly — they are case-sensitive, and anything outside this list is rejected with an error listing the valid types. Every other key in the dict is passed straight through to that plugin’s constructor.

TypeParameters (with defaults)What it does
HighpassFiltercutoff_frequency_hz 50High-pass filter
LowpassFiltercutoff_frequency_hz 50Low-pass filter
PeakFiltercutoff_frequency_hz 440, gain_db 0.0, q 0.707Parametric bell band
HighShelfFiltercutoff_frequency_hz 440, gain_db 0.0, q 0.707High shelf
LowShelfFiltercutoff_frequency_hz 440, gain_db 0.0, q 0.707Low shelf
Compressorthreshold_db 0, ratio 1, attack_ms 1.0, release_ms 100Dynamic range compression
Limiterthreshold_db -10.0, release_ms 100.0Brickwall limiting
Gaingain_db 1.0Simple gain adjustment
NoiseGatethreshold_db -100.0, ratio 10, attack_ms 1.0, release_ms 100.0Gate below a threshold

Note that Limiter sets its ceiling with threshold_db and has no separate makeup gain — put a Gain before it if you need one.

operations

[ {"type": "HighpassFilter", "cutoff_frequency_hz": 80}, {"type": "PeakFilter", "cutoff_frequency_hz": 3000, "gain_db": -4.0, "q": 1.5}, {"type": "LowShelfFilter", "cutoff_frequency_hz": 300, "gain_db": -4.0, "q": 0.7}, {"type": "Gain", "gain_db": -1.0} ]

Example Output

The tool returns the path it wrote and a marker that the chain was user-supplied. It does not report per-operation detail or measure the result — run analyze_loudness on the output if you need to confirm where you landed.

apply_processing

{ "output_path": "/Users/you/.phantom/output/master_bus_fixed.wav", "fixes_applied": ["custom"] }

When to Use It

This tool is for when you know exactly what processing you want applied and want Phantom to execute it. It pairs well with analysis tools: run analyze_loudness to see where you stand, then use apply_processing to get where you need to be.

The difference between this and fix_audio is intent. fix_audio is corrective (find and remove problems). apply_processing is creative (you decide what goes on).

Pro tip

Operations run in the order you list them. Signal flow matters: put your EQ before compression if you want the compressor to react to the shaped signal, or after if you want to shape the compressed result.

Typical Prompts

  • “Apply a high-pass at 80 Hz and gentle compression to the bass stem”
  • “Master this mix: shelf boost at 3k, glue compression, limit to -1 dBTP”
  • “Cut 3 dB at 250 Hz and boost 2 dB at 8 kHz on the vocal”
  • “Run the same EQ and compression chain on all four stems”