Skip to content

Commit 3e62c55

Browse files
make audio chunks contiguous before encoding (comfyanonymous#7942)
1 parent cd18582 commit 3e62c55

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

comfy_api/input_impl/video_types.py

+6-1
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,12 @@ def save_to(
253253
start = i * samples_per_frame
254254
end = start + samples_per_frame
255255
# TODO(Feature) - Add support for stereo audio
256-
chunk = self.__components.audio['waveform'][0, 0, start:end].unsqueeze(0).numpy()
256+
chunk = (
257+
self.__components.audio["waveform"][0, 0, start:end]
258+
.unsqueeze(0)
259+
.contiguous()
260+
.numpy()
261+
)
257262
audio_frame = av.AudioFrame.from_ndarray(chunk, format='fltp', layout='mono')
258263
audio_frame.sample_rate = audio_sample_rate
259264
audio_frame.pts = i * samples_per_frame

0 commit comments

Comments
 (0)