ComfyUI/comfy_api/latest
nahcmon 39f62a0d4c Fix SaveAudioMP3 avcodec_open2 EINVAL crashes
Two separate bugs in AudioSaveHelper.save_audio caused libmp3lame's
avcodec_open2 to fail with EINVAL ([Errno 22] Invalid argument):

1. codec_context.qscale is exposed by PyAV as a bool flag rather than
   the int quality scale libmp3lame expects, so assigning a level (1)
   to it for "V0" quality made avcodec_open2 reject the codec context.
   libmp3lame's default VBR mode is roughly equivalent to V0 quality,
   so the assignment is simply removed.

2. libmp3lame only accepts a fixed set of sample rates (8000, 11025,
   12000, 16000, 22050, 24000, 32000, 44100, 48000 Hz). Audio sources
   that output other rates (e.g. 40000 Hz from some RVC models) were
   passed through unchanged, causing avcodec_open2 to fail. MP3 output
   now remaps to the closest supported rate and resamples, mirroring
   the existing Opus rate-handling logic.

Verified by reproducing both failures directly against PyAV with the
unpatched code and confirming the patched AudioSaveHelper.save_audio
encodes successfully for both the "V0" quality and 40 kHz cases.

Fixes #13937
2026-06-08 18:30:35 +02:00
..
_input [Partner Nodes] fix: respect VideoSlice trim when resizing videos (#14213) 2026-06-01 09:09:57 -07:00
_input_impl [Partner Nodes] fix: respect VideoSlice trim when resizing videos (#14213) 2026-06-01 09:09:57 -07:00
_util feat: Add gaussian splat nodes (#14190) 2026-05-31 11:47:29 -07:00
generated ComfyAPI Core v0.0.2 (#8962) 2025-07-29 22:17:22 -04:00
__init__.py feat: Add gaussian splat nodes (#14190) 2026-05-31 11:47:29 -07:00
_caching.py Revert "Revert "feat: Add CacheProvider API for external distributed caching"" (#12915) 2026-03-12 21:17:50 -07:00
_io_public.py Add MatchType, DynamicCombo, and Autogrow support to V3 Schema (#10832) 2025-12-03 00:17:13 -05:00
_io.py feat: add PreviewGaussianSplat + PreviewPointCloud nodes (#14194) 2026-06-05 12:30:58 -07:00
_ui_public.py Add MatchType, DynamicCombo, and Autogrow support to V3 Schema (#10832) 2025-12-03 00:17:13 -05:00
_ui.py Fix SaveAudioMP3 avcodec_open2 EINVAL crashes 2026-06-08 18:30:35 +02:00