ComfyUI Node

Save Audio

Save clips as wav, mp3, flac — or the oddball formats ASR datasets actually use

By kale4eat·Created 2 years ago·Updated about a year ago· 23
Save Audio
  • audio
    file_nameaudio
    file_format
    filename_prefixComfyUI

    This pack's own save node, and the reason to reach for it over ComfyUI's built-in SaveAudio is one thing: format choice. Vanilla ComfyUI writes flac by default and doesn't give you much else. This one exposes eight formats - wav, mp3, flac, vorbis, sph, amb, amr-nb, gsm - straight from torchaudio's backend, which matters if you're actually building a speech dataset rather than just archiving a clip you generated. Academic ASR corpora often ship in .sph (NIST Sphere); telephony and mobile speech datasets show up in amr-nb or gsm. If your downstream pipeline expects one of those, this is the node that gets you there without a separate conversion pass.

    How it works

    It's a terminal node - no output socket, is_output_node: true. You give it an AUDIO clip and it writes a file to ComfyUI's output/audio_output folder, the same convention the pack sets up on first launch (it creates matching audio_input/audio_output folders alongside ComfyUI's normal input/output dirs). Encoding happens through torchaudio, so whatever formats your installed torchaudio/backend supports, this node can target.

    The inputs and outputs that matter

    • audio - the clip to save, required.
    • file_name (default "audio") - the base name for the file.
    • file_format - pick from the eight formats above. wav if you want something universally readable, flac for lossless without wav's size, mp3/vorbis for lossy and small, the rest for specific downstream tooling.
    • filename_prefix (default "ComfyUI") - prefixed onto the output path, same idea as ComfyUI's other save nodes, useful for keeping runs organized when you're batching a lot of clips out.

    No outputs to wire anywhere - this is where the audio leaves the graph.

    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
    

    Nothing extra for this node specifically - it rides on torchaudio, which the pack already requires for everything.

    Common issues & troubleshooting

    Can't find the saved file. It's not in the regular output/ root - the pack writes audio to output/audio_output, a subfolder it creates at first startup specifically for this pack's audio nodes. Look there first.

    mp3/vorbis save fails or errors on encode. Lossy formats route through backend codecs (libsndfile/sox depending on your torchaudio build) that aren't always present in a minimal environment. If wav and flac work but mp3 doesn't, it's almost always a missing system codec library rather than anything wrong with the node - check what audio backend torchaudio picked up (torchaudio.list_audio_backends()).

    Picked sph/amr-nb/gsm and got an error. These are the least common formats in the list and the most backend-dependent. If you genuinely need them for a legacy speech corpus, confirm your torchaudio build's backend actually supports writing them before you build a whole batch pipeline around it - don't assume every backend does.

    Repo status note: the README itself flags "unsettled policies, destructive changes may be made" - this pack is still evolving, so pin a version if a save-format regression would actually hurt your pipeline.

    Categoryspeech-dataset-toolkit

    Inputs (4)

    NameTypeDefaultDescription
    audioAUDIO
    file_nameSTRINGaudio
    file_formatCOMBO8 options: wav, mp3, flac, vorbis, sph, amb, +2
    filename_prefixSTRINGComfyUI

    Outputs (0)

    No outputs