fix: briefing TTS now uses saved voice/speed/blend settings

synthesiseSpeech() called without explicit params now omits voice/speed/
blend from the request body. The backend detects this and auto-loads all
three from the user's saved settings (voice_tts_voice, voice_tts_speed,
voice_tts_blend), so briefing listen mode respects the voice the user
configured in Settings.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
2026-03-31 13:46:52 -04:00
parent ea23f16bd7
commit ab397e78f3
2 changed files with 20 additions and 7 deletions
+14 -5
View File
@@ -130,16 +130,25 @@ async def synthesise_speech():
if not isinstance(voice_blend, list) or len(voice_blend) < 2:
voice_blend = None
# Auto-load blend from user settings when no explicit voice/blend provided
if voice_blend is None and "voice" not in data and "voice_blend" not in data:
# When no explicit voice/blend/speed provided, load all voice settings from the user's profile
if "voice" not in data and "voice_blend" not in data and "speed" not in data:
from fabledassistant.services.settings import get_setting
from fabledassistant.auth import get_current_user_id
import json as _json
try:
uid = get_current_user_id()
stored = await get_setting(uid, "voice_tts_blend", "")
if stored:
parsed = _json.loads(stored)
saved_voice = await get_setting(uid, "voice_tts_voice", "")
if saved_voice:
voice = saved_voice
saved_speed = await get_setting(uid, "voice_tts_speed", "")
if saved_speed:
try:
speed = float(saved_speed)
except ValueError:
pass
saved_blend = await get_setting(uid, "voice_tts_blend", "")
if saved_blend:
parsed = _json.loads(saved_blend)
if isinstance(parsed, list) and len(parsed) >= 2:
voice_blend = parsed
except Exception: