diff --git a/templates/spatial-showcase/agent.ts b/templates/spatial-showcase/agent.ts index 86f2cb1..2c64b4a 100644 --- a/templates/spatial-showcase/agent.ts +++ b/templates/spatial-showcase/agent.ts @@ -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; @@ -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; } diff --git a/templates/spatial-showcase/sounds.ts b/templates/spatial-showcase/sounds.ts index 92c70b8..79b9d92 100644 --- a/templates/spatial-showcase/sounds.ts +++ b/templates/spatial-showcase/sounds.ts @@ -35,6 +35,8 @@ export const SHOWCASE_SOUND_FILES: Record = { 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; diff --git a/test/spatial-showcase.test.ts b/test/spatial-showcase.test.ts index bdfa15c..6fb5b44 100644 --- a/test/spatial-showcase.test.ts +++ b/test/spatial-showcase.test.ts @@ -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", () => {