mirror of
https://github.com/comfyanonymous/ComfyUI.git
synced 2025-06-08 20:42:11 +08:00
make audio chunks contiguous before encoding (#7942)
This commit is contained in:
parent
cd18582578
commit
3e62c5513a
@ -253,7 +253,12 @@ class VideoFromComponents(VideoInput):
|
|||||||
start = i * samples_per_frame
|
start = i * samples_per_frame
|
||||||
end = start + samples_per_frame
|
end = start + samples_per_frame
|
||||||
# TODO(Feature) - Add support for stereo audio
|
# 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 = av.AudioFrame.from_ndarray(chunk, format='fltp', layout='mono')
|
||||||
audio_frame.sample_rate = audio_sample_rate
|
audio_frame.sample_rate = audio_sample_rate
|
||||||
audio_frame.pts = i * samples_per_frame
|
audio_frame.pts = i * samples_per_frame
|
||||||
|
Loading…
x
Reference in New Issue
Block a user