Nodes/MKRShift_Nodes/Audio Resample + Convert
ComfyUI Node

Audio Resample + Convert

Resample to 48k and pick your channel layout in one step

By criskb·Created 7 months ago·Updated 5 months ago· 0
Audio Resample + Convert
  • audio
  • audio
  • output_path
  • duration_sec
  • summary
target_sample_rate48000
target_channelskeep
output_formatauto
filename_prefixMKR_audio_resample
subfolder
overwritefalse
filename_label

Video pipelines have a hard rule: audio goes to 48 kHz for picture work. Music models often hand you 44.1 kHz, TTS sometimes delivers 24 kHz, and if you mux a 44.1 kHz track onto a 48 kHz video without converting, the playback is subtly wrong - drift, pitch artifacts, and player hiccups. MKRAudioResampleConvert is the node that fixes both the sample rate and the channel layout at once, so your audio lands in the shape your delivery target expects.

It's a Utility in the MKRShift_Nodes audio set - the boring-but-essential setup step you run before muxing with MKRMuxVideoAudio or MKRPresaveAudio. Think of it as the audio equivalent of "resize to target resolution" in a video chain: you do it once, early, and everything downstream assumes the standard.

How it works

The node decodes the input waveform and, if you set a target_sample_rate, resamples it. With ffmpeg available the resample goes through aresample; otherwise it falls back to numpy linear interpolation (works fine, slightly less clean on big rate changes like 44.1k→192k). Channel conversion is pure numpy:

  • keep - leave channels as-is.
  • mono - average down to one channel (the standard downmix).
  • stereo - duplicate mono to both channels, or take the first two channels if the source has more.

Order of operations matters and is handled for you: resample first, then channel conversion, so you never resample after a downmix.

Inputs that matter

  • audio - MKR_AUDIO payload, waveform tensor, or file path.
  • target_sample_rate - 8000 to 192000, default 48000. 48k for video, 44.1k for music delivery, 16k if you're feeding it to a speech model later.
  • target_channels - keep/mono/stereo. Pick stereo if the mux target expects a stereo track.
  • Standard save block: output_format (auto keeps the source container - note this changes the container, not the rate), filename_prefix, subfolder, overwrite, optional filename_label.

Outputs: audio (MKR_AUDIO), output_path, duration_sec, summary (includes the resulting sample rate and channel count so you can verify).

Install

ComfyUI Manager (search "MKRShift Nodes"), or:

cd ComfyUI/custom_nodes
git clone https://github.com/criskb/MKRShift_Nodes

Restart. No models. ffmpeg is recommended for quality resampling and for non-WAV output, but the numpy fallback keeps the node usable without it.

Common issues

The trap is confusing output_format with target_sample_rate: setting output_format to mp3 re-encodes but does not resample - those are separate knobs, and mp3 at 44.1k stays 44.1k unless you also set the rate. Second, downsampling to mono averages channels, so if one channel is broken or silent, your mono mix inherits that - fix channels first with MKRAudioChannelRouter, then convert. And upsampling (say 24k→48k) never adds information - it just fills in the gaps, so don't expect a "better" voice from the higher rate.

CategoryMKRShift Nodes/Media/Audio/Utility

Inputs (8)

NameTypeDefaultDescription
audio*
target_sample_rateINT480008000–192000
target_channelsCOMBOkeep3 options: keep, mono, stereo
output_formatCOMBOauto5 options: auto, wav, mp3, flac, ogg
filename_prefixSTRINGMKR_audio_resample
subfolderSTRING
overwriteBOOLEANfalse
filename_labeloptSTRING

Outputs (4)

NameTypeDescription
audioMKR_AUDIO
output_pathSTRING
duration_secFLOAT
summarySTRING