diff --git a/packages/cli/src/tts/synthesize.cache.test.ts b/packages/cli/src/tts/synthesize.cache.test.ts index f31f4e77d8b..0707498689e 100644 --- a/packages/cli/src/tts/synthesize.cache.test.ts +++ b/packages/cli/src/tts/synthesize.cache.test.ts @@ -53,6 +53,14 @@ describe("synthesis script cache", () => { fs.rmSync(paths.home, { recursive: true, force: true }); }); + it("turns off onnxruntime telemetry for the synthesis process", async () => { + const { synthesize } = await import("./synthesize.js"); + await synthesize("Hello", outputPath); + + const options = vi.mocked(execFileSync).mock.calls.at(-1)?.[2]; + expect(options?.env?.ORT_DISABLE_TELEMETRY).toBe("1"); + }); + it("creates the script, removes only old script versions, and reuses the current cache", async () => { fs.writeFileSync(join(cacheDir, "synth-v2.py"), "old script"); fs.writeFileSync(join(cacheDir, "notes.txt"), "keep"); diff --git a/packages/cli/src/tts/synthesize.ts b/packages/cli/src/tts/synthesize.ts index a32f299ebd3..764084cc625 100644 --- a/packages/cli/src/tts/synthesize.ts +++ b/packages/cli/src/tts/synthesize.ts @@ -202,6 +202,7 @@ export async function synthesize( encoding: "utf-8", timeout: 300_000, stdio: ["pipe", "pipe", "pipe"], + env: { ...process.env, ORT_DISABLE_TELEMETRY: "1" }, }, );