{"record":{"id":"9a0387113477d233","repo":"Comfy-Org/ComfyUI","slug":"previewaudio-input-audio-is-none-source-video-ma","errorCode":null,"errorMessage":"PreviewAudio: input audio is None (source video may have no audio track).","messagePattern":"PreviewAudio: input audio is None \\(source video may have no audio track\\)\\.","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"comfy_extras/nodes_audio.py","lineNumber":317,"sourceCode":"    def define_schema(cls):\n        return IO.Schema(\n            node_id=\"PreviewAudio\",\n            search_aliases=[\"play audio\"],\n            display_name=\"Preview Audio\",\n            category=\"audio\",\n            description=\"Preview the audio without saving it to the ComfyUI output directory.\",\n            inputs=[\n                IO.Audio.Input(\"audio\"),\n            ],\n            hidden=[IO.Hidden.prompt, IO.Hidden.extra_pnginfo],\n            is_output_node=True,\n            outputs=[IO.Audio.Output(\"audio\")]\n        )\n\n    @classmethod\n    def execute(cls, audio) -> IO.NodeOutput:\n        if audio is None:\n            raise ValueError(\"PreviewAudio: input audio is None (source video may have no audio track).\")\n        return IO.NodeOutput(audio, ui=UI.PreviewAudio(audio, cls=cls))\n\n    save_flac = execute  # TODO: remove\n\n\ndef f32_pcm(wav: torch.Tensor) -> torch.Tensor:\n    \"\"\"Convert audio to float 32 bits PCM format.\"\"\"\n    if wav.dtype.is_floating_point:\n        return wav\n    elif wav.dtype == torch.int16:\n        return wav.float() / (2 ** 15)\n    elif wav.dtype == torch.int32:\n        return wav.float() / (2 ** 31)\n    raise ValueError(f\"Unsupported wav dtype: {wav.dtype}\")\n\ndef load(filepath: str) -> tuple[torch.Tensor, int]:\n    with av.open(filepath) as af:\n        if not af.streams.audio:","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/Comfy-Org/ComfyUI/blob/1c6d8d45b3693bfbb32385b410d813a7fd6be216/comfy_extras/nodes_audio.py#L299-L335","documentation":"PreviewAudio.execute raises when audio is None. Preview nodes render audio in the UI, and a None (classically produced by LoadVideo on a silent video) cannot be previewed, so the node rejects it explicitly rather than erroring deeper in the UI layer.","triggerScenarios":"Connecting a video loader's audio output (None because no audio track) to PreviewAudio; unconnected optional audio inputs in a partially wired graph.","commonSituations":"Debugging pipelines on silent test clips; previewing after a trim/split operation that returned None for empty input.","solutions":["Use a source with a real audio track, verified via ffprobe","Drive the preview from LoadAudio or a generator instead","Bypass/switch off the preview node when the audio is None"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":"if audio is not None:\n    preview(audio)  # only preview real audio","typeGuard":"def is_audio(v) -> bool:\n    return isinstance(v, dict) and 'waveform' in v and 'sample_rate' in v","tryCatchPattern":null,"preventionTips":["Bypass preview nodes when audio is None","Confirm test clips have audio before previewing","Route preview from LoadAudio rather than silent video taps"],"tags":["audio","preview","none-input"],"backgroundTag":null,"analyzedSha":"1c6d8d45b3693bfbb32385b410d813a7fd6be216","analyzedAt":"2026-08-14T19:37:18.893Z","schemaVersion":2},"datasetVersion":"2026-08-15T22:17:37.221Z"}