Personal_AI_Infrastructure
Personal_AI_Infrastructure copied to clipboard
Bug: pai-voice-system server.ts doesn't resolve voice_id from personality config
Summary
Even when voice-personalities config loads successfully, the voice server passes the personality name (e.g., "marrvin") to ElevenLabs API instead of the actual voice_id from the config.
Related Issues
- #393 - Config path mismatch (must be fixed first for this bug to manifest)
- #346 - ENV path inconsistent (related path issues)
Expected Behavior
When hook sends voice_id: "marrvin":
- Server looks up "marrvin" in voice-personalities config
- Finds
voice_id: "K5QbygPi6edprgmNThSP" - Sends actual ElevenLabs voice ID to API
Actual Behavior
Server finds config but still sends "marrvin" to ElevenLabs:
📨 Notification: "Marrvin" - "Hello" (voice: true, voiceId: marrvin)
👤 Personality: Ian's primary AI assistant # Config WAS found
🎙️ Generating speech (voice: marrvin, ...) # But name sent, not voice_id
ElevenLabs API error: 404 - voice_not_found "marrvin"
Root Cause
In server.ts sendNotification() function (around line 365-388):
const voice = voiceId || DEFAULT_VOICE_ID; // "marrvin"
const voiceConfig = getVoiceConfig(voice); // Finds config with voice_id field
// BUG: Uses `voice` (the name) instead of voiceConfig.voice_id
const audioBuffer = await generateSpeech(safeMessage, voice, voiceSettings);
The code retrieves the config (and uses its stability/similarity_boost settings) but never extracts the actual voice_id field.
Fix
const voice = voiceId || DEFAULT_VOICE_ID;
const voiceConfig = getVoiceConfig(voice);
// Resolve the actual ElevenLabs voice ID from config
const actualVoiceId = voiceConfig?.voice_id || voice;
const audioBuffer = await generateSpeech(safeMessage, actualVoiceId, voiceSettings);
Affected Files
Packs/pai-voice-system/src/voice/server.ts-sendNotification()function, around line 388
Thanks for reporting! The voice system was restructured in v3.0 (now released) with improved voice_id resolution. Please upgrade to v3.0.