Skip to content

Self-hosted, Self-Improving, Federated Everything App — dev management, agent orchestration, persistent mind, digital twin, second brain, and creative pipeline from a single dashboard over Tailscale to port the user into the OS

address review: use uuid+pid for windows piper temp filename

Adam Eivya0132c6c0012
diff --git a/server/services/voice/tts-piper.js b/server/services/voice/tts-piper.js
index 3b20142467..ef4326729a 100644
--- a/server/services/voice/tts-piper.js
+++ b/server/services/voice/tts-piper.js
@@ -1,6 +1,7 @@
// Piper TTS backend — spawn-per-request CLI: text on stdin, WAV on stdout.
import { spawn } from 'child_process';
+import { randomUUID } from 'crypto';
import { existsSync, readFileSync, unlinkSync } from 'fs';
import { tmpdir } from 'os';
import { delimiter, join } from 'path';
@@ -24,7 +25,7 @@ export const synthesizePiper = (text, cfg, signal) => {
const lengthScale = String(1 / rate);
// On Windows, piper.exe writes stdout in text mode which corrupts binary WAV
// (CR+LF expansion). Use a temp file and read it back instead.
- const tmpFile = IS_WIN ? join(tmpdir(), `piper-${Date.now()}.wav`) : null;
+ const tmpFile = IS_WIN ? join(tmpdir(), `piper-${process.pid}-${randomUUID()}.wav`) : null;
const args = ['--model', voicePath, '--length_scale', lengthScale, '--output_file', tmpFile ?? '-'];
// Multi-speaker voices (VCTK) need a speaker index. Prefer the per-session