strip trailing silence padding in vocoder_chunked (single-chunk path)
Browse files- python/infer_board.py +2 -1
python/infer_board.py
CHANGED
|
@@ -150,7 +150,8 @@ def vocoder_chunked(vocoder, mel):
|
|
| 150 |
if T <= VOC_CHUNK:
|
| 151 |
m = np.pad(mel, ((0, 0), (0, 0), (0, VOC_CHUNK - T)),
|
| 152 |
constant_values=-11.5)
|
| 153 |
-
|
|
|
|
| 154 |
hop = VOC_CHUNK - VOC_OVERLAP
|
| 155 |
starts = list(range(0, T, hop))
|
| 156 |
frame = 256
|
|
|
|
| 150 |
if T <= VOC_CHUNK:
|
| 151 |
m = np.pad(mel, ((0, 0), (0, 0), (0, VOC_CHUNK - T)),
|
| 152 |
constant_values=-11.5)
|
| 153 |
+
w = vocoder.run(None, {"mel": m})[0][0, 0]
|
| 154 |
+
return w[:T * 256] # strip trailing silence padding
|
| 155 |
hop = VOC_CHUNK - VOC_OVERLAP
|
| 156 |
starts = list(range(0, T, hop))
|
| 157 |
frame = 256
|