Files
whisper_web/tests/meetingFixture.test.ts
T

23 lines
1.2 KiB
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
import { describe, expect, test } from "bun:test";
import { ALIEN_EXCERPTS, buildMeetingFixture } from "./meetingFixture";
describe("buildMeetingFixture (SYNTHETIC meeting stand-in)", () => {
test("joins en_aiproblem and the en_alien excerpts with pauses, deterministically", async () => {
const first = await buildMeetingFixture();
const second = await buildMeetingFixture();
const seconds = first.audio.length / 16_000;
const excerptSeconds = ALIEN_EXCERPTS.reduce((n, e) => n + e.end - e.start, 0);
// lead-in 2 + aiproblem ≈ 14.4 + excerpts + pauses 3+8+2+5
expect(seconds).toBeCloseTo(2 + 14.4 + excerptSeconds + 18, 0);
expect(first.audio).toEqual(second.audio);
expect(first.reference).toBe(second.reference);
expect(first.reference).toStartWith("The problem I find with AI");
expect(first.reference).toContain("Voices of the Void");
expect(first.reference).toEndWith("Maybe no.");
// Pauses are room tone, not digital silence, and never louder than −50 dBFS.
const leadIn = first.audio.subarray(0, 2 * 16_000);
expect(leadIn.some((v) => v !== 0)).toBe(true);
expect(Math.max(...leadIn.map(Math.abs))).toBeLessThan(0.003);
}, 60_000); // decodes the 15-min en_alien twice
});