Skip to content

Commit c458cb4

Browse files
authored
fix audio loading bugs (#1690)
1 parent cc36552 commit c458cb4

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

diffsynth/core/data/operators.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -359,6 +359,8 @@ def load_audio(self, path):
359359
sample_rate = self.target_sample_rate
360360
if self.max_audio_duration is not None and waveform.shape[1] > sample_rate * self.max_audio_duration:
361361
waveform = waveform[:, :int(sample_rate * self.max_audio_duration)]
362+
if self.division_factor is not None:
363+
waveform = waveform[:, :waveform.shape[1] // self.division_factor * self.division_factor]
362364
return waveform
363365

364366
def load_latents(self, path):

0 commit comments

Comments
 (0)