Skip to content

Commit e0dc542

Browse files
authored
Fix crossfade bug
1 parent 84042df commit e0dc542

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

crossfade.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@ def cross_fade(a: np.ndarray, b: np.ndarray, idx: int):
66
fade_len = a.shape[0] - idx
77
np.copyto(result[:idx], a[:idx])
88
k = np.linspace(0, 1.0, num=fade_len, endpoint=True)
9-
result[idx: a.shape[0]] = k * a[idx:] + (1 - k) * b[: fade_len]
9+
result[idx: a.shape[0]] = (1 - k) * a[idx:] + k * b[: fade_len]
1010
np.copyto(b[fade_len:], result[a.shape[0]:])
1111
return result

0 commit comments

Comments
 (0)