Audio Channel Router
Fix, flip, and fold stereo audio without leaving ComfyUI
- audio
- audio
- output_path
- duration_sec
- summary
Half the audio problems you'll meet in a ComfyUI video pipeline are channel problems, and they're boring to solve by hand: the voice came out mono when you need stereo, the left/right are swapped, or you're trying to widen a stereo field and need it in mid/side form first. MKRAudioChannelRouter is the one-stop node for all of it - eight channel operations in a single dropdown, done in numpy, no ffmpeg required for the routing itself.
This is genuinely the node you reach for when a generated soundtrack lands in the wrong shape, or when you're staging audio for another FX node downstream. It pairs naturally with MKRAudioStereoWidth in the same pack, since width processing really wants mid/side.
How it works
The node decodes your input to a waveform (channels × samples) and applies one of eight modes:
keep- pass-through, mostly there so one node can unify format handling.mono_mix- averages channels down to one. Great for dialogue.left_only/right_only- keeps one channel, duplicated to both speakers. The classic way to rescue a single broken channel.swap_lr- flips the stereo image. Instant fix for inverted L/R exports.stereo_from_mono- duplicates mono to both channels (wider-safe).mid_side_encode- converts L/R into M/S. The step before stereo-width work or before side-channel processing.mid_side_decode- converts M/S back to L/R. Run the pair to do mid/side surgery.
The mid/side math is the same one every mixer uses: mid = (L+R)/2, side = (L−R)/2, and decoding is the inverse. Feed a mono file to swap_lr or mid_side_decode and it degrades gracefully with a warning in summary rather than throwing.
Inputs that matter
audio-MKR_AUDIOpayload, waveform tensor, or file path string; the*input type means ComfyUI won't second-guess you.mode- the eight-option enum above. That's the whole node, really.- The standard save block:
output_format(autokeeps the source format, else wav/mp3/flac/ogg),filename_prefix,subfolder,overwrite, optionalfilename_label.
Outputs: audio (MKR_AUDIO), output_path, duration_sec, summary (JSON including which mode ran).
Install
ComfyUI Manager (search "MKRShift Nodes"), or:
cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes
Restart, and you're done - no models, no dependencies beyond numpy/PIL. ffmpeg is only needed if you write compressed formats; WAV works out of the box.
Common issues
The one that trips people: stereo_from_mono does not widen a mono signal, it just mirrors it - if that's what you meant by "make it stereo," fine, but the actual widening tool is MKRAudioStereoWidth. And after a mid_side_encode, don't listen to the result as if it were normal stereo - the side channel sounds like room tone and that's correct. Decode it back (or process it) before judging.
Inputs (7)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | * | — | |
| mode | COMBO | keep | 8 options: keep, mono_mix, left_only, right_only, swap_lr, stereo_from_mono, +2 |
| output_format | COMBO | auto | 5 options: auto, wav, mp3, flac, ogg |
| filename_prefix | STRING | MKR_audio_channel_router | — |
| subfolder | STRING | — | |
| overwrite | BOOLEAN | false | — |
| filename_labelopt | STRING | — |
Outputs (4)
| Name | Type | Description |
|---|---|---|
| audio | MKR_AUDIO | — |
| output_path | STRING | — |
| duration_sec | FLOAT | — |
| summary | STRING | — |