TTSService: Remove newlines before sending text to TTS service to generate

This commit is contained in:
Mark Backman
2025-02-25 12:48:38 -05:00
parent e74864335b
commit 92cc6d39f2
2 changed files with 7 additions and 0 deletions

View File

@@ -399,6 +399,9 @@ class TTSService(AIService):
await self._push_tts_frames(text)
async def _push_tts_frames(self, text: str):
# Remove leading newlines only
text = text.lstrip("\n")
# Don't send only whitespace. This causes problems for some TTS models. But also don't
# strip all whitespace, as whitespace can influence prosody.
if not text.strip():