Initial Commit

This commit is contained in:
2026-05-27 23:47:53 +01:00
parent fbc70f96e6
commit 9b28db724f
18103 changed files with 1600554 additions and 0 deletions

View File

@@ -0,0 +1,49 @@
import { TimelineEngine } from "@suaveplan/audio-timeline";
import { describe, expect, it } from "@suaveplan/testing/runner";
import { BrowserTimelineAdapter } from "../src/adapter/browser-adapter.js";
import { renderOffline } from "../src/offline/offline-render.js";
import { FakeAudioContext } from "./fake-context.js";
describe("BrowserTimelineAdapter integration", () => {
it("TimelineEngine drives BrowserTimelineAdapter end to end", {
timeout: 30000,
}, async () => {
const ctx = new FakeAudioContext();
const adapter = new BrowserTimelineAdapter({
context: ctx as never,
});
await adapter.init();
const timeline = new TimelineEngine();
timeline.setAdapter(adapter);
timeline.setTracks([
{
id: "t1",
name: "t1",
clips: [],
volume: 1,
muted: false,
soloed: false,
pan: 0,
},
]);
timeline.play();
expect(adapter.snapshotGraph().nodes["t1:track-gain"]).toBe("gain");
adapter.dispose();
});
it("offline render integration with TimelineEngine", {
timeout: 30000,
}, async () => {
const timeline = new TimelineEngine();
const buffer = await renderOffline(timeline, 1, 22050, {
contextFactory: (args) =>
new FakeAudioContext({
length: args.length,
sampleRate: args.sampleRate,
offline: true,
}),
});
expect(buffer.length).toBe(22050);
expect(buffer.sampleRate).toBe(22050);
});
});