We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 9207611 + c73d844 commit c3f7b56Copy full SHA for c3f7b56
app.py
@@ -131,7 +131,10 @@ def adjust_f0_semitones(f0_sequence, n_semitones):
131
def crossfade(chunk1, chunk2, overlap):
132
fade_out = np.cos(np.linspace(0, np.pi / 2, overlap)) ** 2
133
fade_in = np.cos(np.linspace(np.pi / 2, 0, overlap)) ** 2
134
- chunk2[:overlap] = chunk2[:overlap] * fade_in + chunk1[-overlap:] * fade_out
+ if len(chunk2) < overlap:
135
+ chunk2[:overlap] = chunk2[:overlap] * fade_in[:len(chunk2)] + (chunk1[-overlap:] * fade_out)[:len(chunk2)]
136
+ else:
137
+ chunk2[:overlap] = chunk2[:overlap] * fade_in + chunk1[-overlap:] * fade_out
138
return chunk2
139
140
# streaming and chunk processing related params
0 commit comments