MFCC
The classic hand-crafted speech feature, still useful for lightweight tasks
- audio
- spec
Mel-Frequency Cepstral Coefficients predate the deep learning era of speech processing by decades and were the dominant hand-crafted feature for speech and speaker recognition before end-to-end neural models took over. They haven't gone away - they're still a solid, cheap feature for lightweight classifiers, voice activity detection, and any task where you want a compact, decorrelated summary of a clip's spectral shape rather than the full detail of a spectrogram.
How it works
It's a mel spectrogram (same idea as SDT_MelSpectrogram) taken one step further: log-compress the mel filterbank energies, then run a discrete cosine transform (DCT) across the mel bins. The DCT does two useful things - it decorrelates the mel energies (adjacent mel bins tend to be highly correlated; the DCT spreads that redundancy out) and it compacts most of the useful information into the first several coefficients, which is why you keep only n_mfcc of them rather than the full mel bin count. The result is a much smaller, denser representation than a raw spectrogram, at the cost of losing the fine detail you'd need to resynthesize audio from it.
The inputs and outputs that matter
audio- the clip to analyze, required.n_mfcc(default40) - how many cepstral coefficients to keep after the DCT. This is the number that defines your feature's dimensionality; lower values are more compact but throw away more detail, and if you're matching an existing dataset or model's feature format, this needs to match that convention exactly.n_fft(default1024) andn_mels(default256) - the underlying mel spectrogram's FFT size and filterbank resolution, computed as an intermediate step before the DCT. Note these defaults differ fromSDT_MelSpectrogram's own defaults (400/128) - this node isn't just wrapping that one with fixed settings, it has its own tuning.win_lengthandhop_length(optional, both default-1) - same torchaudio-derived-default convention as elsewhere in the pack; leave alone unless you need a specific frame rate.spec(output,SPEC) - the MFCC coefficients, typed the same as this pack's other spectrogram-family outputs.
How to install it
ComfyUI Manager: search ComfyUI-speech-dataset-toolkit, install, restart. Manual:
cd ComfyUI/custom_nodes
git clone https://github.com/kale4eat/ComfyUI-speech-dataset-toolkit
cd ComfyUI-speech-dataset-toolkit
pip install torchaudio --index-url https://download.pytorch.org/whl/cu121
pip install -r requirements.txt
No extra dependencies - pure torchaudio signal processing, nothing to download.
Common issues & troubleshooting
Trying to reconstruct audio from this and getting nothing sensible. MFCC is lossy by design - the DCT and coefficient truncation throw away information a spectrogram-to-audio step like SDT_GriffinLim needs. If you need to go back to audio, work from SDT_MelSpectrogram or the raw waveform instead; MFCC is a one-way feature for classification-style tasks, not an intermediate you invert.
Feature dimension doesn't match a pretrained classifier or reference dataset. Check n_mfcc first - it's the single number that defines output width, and a mismatch there is the most common cause of a shape error feeding this into something downstream.
Not sure whether MFCC or LFCC is the right feature. If you're building general-purpose speaker or content classification features, MFCC's mel-scale weighting (biased toward how humans perceive pitch) is the conventional default. If your actual goal leans toward detecting synthetic or manipulated speech, SDT_LFCC's linear frequency spacing tends to preserve more of the high-frequency artifacts that give away a vocoder - that's a large part of why LFCC shows up as a baseline feature in anti-spoofing research specifically.
Values look noisy or inconsistent between similar clips. MFCC is sensitive to the underlying spectral energy, which means recording level, background noise, and even microphone differences show up in the coefficients. If you're comparing clips from different sources, normalize loudness first rather than assuming raw MFCC values are directly comparable.
Inputs (6)
| Name | Type | Default | Description |
|---|---|---|---|
| audio | AUDIO | — | |
| n_mfcc | INT | 400–4294967296 | — |
| n_fft | INT | 10240–4294967296 | — |
| n_mels | INT | 2560–4294967296 | — |
| win_lengthopt | INT | -1-1–4294967296 | — |
| hop_lengthopt | INT | -1-1–4294967296 | — |
Outputs (1)
| Name | Type | Description |
|---|---|---|
| spec | SPEC | — |