diff options
| author | Zakaria Zbitou <zbitou.zakaria@gmail.com> | 2026-08-23 19:57:11 +0200 |
|---|---|---|
| committer | Zakaria Zbitou <zbitou.zakaria@gmail.com> | 2026-08-23 19:57:11 +0200 |
| commit | 10b4427640f3e6c1f4a1778ef0526bbc0691f586 (patch) | |
| tree | beb6bb6aab2c2d30145e341f5d2039ee119486ba /tests/test_inference.py | |
| parent | ab97f7cf5d16bc2f58c069ee48621124bc024644 (diff) | |
| download | apollo-gfx803-10b4427640f3e6c1f4a1778ef0526bbc0691f586.tar.gz | |
Clamp the padded chunk start and derive the crop offset from it
Diffstat (limited to 'tests/test_inference.py')
| -rw-r--r-- | tests/test_inference.py | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/tests/test_inference.py b/tests/test_inference.py index c6360b5..f6e1380 100644 --- a/tests/test_inference.py +++ b/tests/test_inference.py @@ -297,16 +297,15 @@ class InferenceTests(unittest.TestCase): self.assertFalse(np.isfinite(output).all()) def test_chunk_padding_wider_than_the_hop_reproduces_the_input(self): - """Regression: chunk padding wider than the hop silenced whole chunks. + """ + Regression test `padded_start` was `start - chunk_pad_samples` for every chunk after - the first, which goes negative once the padding exceeds the hop. A - negative slice start is read from the end of the audio, so the slice - came back empty and `F.pad` filled the whole chunk with zeros, which - the crossfades then blended into the output. + the first, which goes negative once the padding exceeds the hop, and + makes slicing index from the end of the file - Reproducing it needs padding wider than the hop and a chunk after the - first, so the file has to hold at least two chunks: 0.5 s chunks with + The test reproduces the bug, it needs padding wider than the hop, + so the file has to hold at least two chunks: 0.5 s chunks with a 0.1 s overlap leave a 0.4 s hop, and 0.5 s of padding exceeds it. The second chunk starts at 0.4 s, giving `padded_start = -0.1 s`. """ |
