Spaces:
Running
on
Zero
Running
on
Zero
liubaiji
commited on
Commit
•
df653f1
1
Parent(s):
c901a12
[refator] modify fade_in_out func to a commom form
Browse files
cosyvoice/utils/common.py
CHANGED
@@ -139,6 +139,7 @@ def fade_in_out(fade_in_mel, fade_out_mel, window):
|
|
139 |
device = fade_in_mel.device
|
140 |
fade_in_mel, fade_out_mel = fade_in_mel.cpu(), fade_out_mel.cpu()
|
141 |
mel_overlap_len = int(window.shape[0] / 2)
|
142 |
-
|
143 |
-
|
|
|
144 |
return fade_in_mel.to(device)
|
|
|
139 |
device = fade_in_mel.device
|
140 |
fade_in_mel, fade_out_mel = fade_in_mel.cpu(), fade_out_mel.cpu()
|
141 |
mel_overlap_len = int(window.shape[0] / 2)
|
142 |
+
|
143 |
+
fade_in_mel[..., :mel_overlap_len] = fade_in_mel[..., :mel_overlap_len] * window[:mel_overlap_len] + \
|
144 |
+
fade_out_mel[..., -mel_overlap_len:] * window[mel_overlap_len:]
|
145 |
return fade_in_mel.to(device)
|