Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 4 additions & 3 deletions templates/spatial-showcase/agent.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,9 @@ import {
orbitSineClipDurationMs,
} from "./sine.js";

const ORBIT_TICK_MS = 50;
const ORBIT_POSE_EMIT_MS = 100;
const ORBIT_POSE_HZ = 60;
const ORBIT_TICK_MS = 1000 / ORBIT_POSE_HZ;
const ORBIT_POSE_EMIT_MS = ORBIT_TICK_MS;
const ROOM_STATE_TICK_MS = 100;
const LOOP_PAD_POLL_MS = 250;
const ORBIT_SINE_POLL_MS = 250;
Expand Down Expand Up @@ -426,7 +427,7 @@ function emitOrbitPose(sessionId: string, state: SessionState): void {
const now = Date.now();
if (
state.lastOrbitPoseEmitMs !== undefined &&
now - state.lastOrbitPoseEmitMs < ORBIT_POSE_EMIT_MS
now - state.lastOrbitPoseEmitMs < ORBIT_POSE_EMIT_MS - 2
) {
return;
}
Expand Down
2 changes: 2 additions & 0 deletions templates/spatial-showcase/sounds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ export const SHOWCASE_SOUND_FILES: Record<ShowcaseClipId, ShowcaseSoundFile> = {
export const SHOWCASE_ASSET_ORIGINS = [
"https://app.voicethere.io",
"https://app.voicethere.dev",
"https://www.voicethere.io",
"https://voicethere.io",
"http://localhost:3000",
] as const;

Expand Down
6 changes: 6 additions & 0 deletions test/spatial-showcase.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -264,6 +264,12 @@ describe("resolveClipUrl", () => {
expect(resolveClipUrl("http://localhost:3000", "laser")).toBe(
"http://localhost:3000/showcase/sounds/laser.wav",
);
expect(resolveClipUrl("https://www.voicethere.io", "cafe-loop")).toBe(
"https://www.voicethere.io/showcase/sounds/cafe-loop.wav",
);
expect(resolveClipUrl("https://voicethere.io", "chime")).toBe(
"https://voicethere.io/showcase/sounds/chime.wav",
);
});

it("trims trailing slash on origin", () => {
Expand Down
Loading