From 26265cd8d2390bbea3cbd23db184be59e7e98792 Mon Sep 17 00:00:00 2001 From: bymyself Date: Sun, 4 May 2025 19:29:35 -0700 Subject: [PATCH] make audio chunks contiguous before encoding --- comfy_api/input_impl/video_types.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/comfy_api/input_impl/video_types.py b/comfy_api/input_impl/video_types.py index 12e5783db..d5be1f9d8 100644 --- a/comfy_api/input_impl/video_types.py +++ b/comfy_api/input_impl/video_types.py @@ -211,7 +211,12 @@ class VideoFromComponents(VideoInput): start = i * samples_per_frame end = start + samples_per_frame # TODO(Feature) - Add support for stereo audio - chunk = self.__components.audio['waveform'][0, 0, start:end].unsqueeze(0).numpy() + chunk = ( + self.__components.audio["waveform"][0, 0, start:end] + .unsqueeze(0) + .contiguous() + .numpy() + ) audio_frame = av.AudioFrame.from_ndarray(chunk, format='fltp', layout='mono') audio_frame.sample_rate = audio_sample_rate audio_frame.pts = i * samples_per_frame