Release Subtitle Tools 0.2.0
Verify / verify (push) Canceled after 0s

This commit is contained in:
2026-09-02 08:44:49 +02:00
parent b92793eb82
commit 88c2bcd0ff
36 changed files with 1354 additions and 182 deletions
+15
View File
@@ -0,0 +1,15 @@
import { describe, expect, it } from "vitest";
import { extractPeaks } from "../../src/media/peaks";
describe("waveform peak extraction", () => {
it("covers every sample when bucket sizes are uneven", () => {
const peaks = extractPeaks(Float32Array.of(0.1, -0.8, 0.2, 0.4, -1), 2);
expect(peaks[0]).toBeCloseTo(0.8);
expect(peaks[1]).toBe(1);
});
it("rejects invalid bounds and handles empty PCM", () => {
expect(extractPeaks(new Float32Array(), 5)).toHaveLength(0);
expect(() => extractPeaks(Float32Array.of(1), 0)).toThrow(/positive/u);
});
});