wooden-librarian-60399
08/22/2025, 3:08 AMtall-airline-16756
08/22/2025, 3:08 AMtall-airline-16756
08/22/2025, 3:08 AMwooden-librarian-60399
08/22/2025, 3:27 AMtall-airline-16756
08/22/2025, 3:27 AMbefore_tts_cb parameter in the VoicePipelineAgent. Think of it as a handy callback function that lets you adjust the LLM output before it goes to the TTS engine.
• Version 1.x: Here, you’d override the tts_node or llm_node in the pipeline, which gives you even more flexibility to modify the text before synthesis.
For instance, you might want to swap out special tokens like <tool_call> or casual phrases like "lol" with something that sounds better when spoken by TTS. If you'd like, I’m happy to share more details or examples to help you get started!
Sources: chain-of-thought-tts/README.mdoc | Agents 0.x migration guide | LiveKit Docs | Pipeline nodes and hooks | LiveKit Docs | Modifying LLM output before TTS | LiveKit Docs | pipeline-llm/replacing_llm_output.pywooden-librarian-60399
08/22/2025, 3:29 AMtall-airline-16756
08/22/2025, 3:29 AM[null], there’s a neat workaround. You can actually catch and tweak the LLM output before it gets to the TTS node. By customizing the llm_node in your agent, you can spot specific strings (like [null]) and stop them from moving forward.
Here’s a couple of ideas you might find helpful:
• Swap out [null] for an empty string or some other text that fits better.
• Simply yield nothing or skip that part of the stream, so the TTS stays quiet when you want it to.
This way, you have control over when speech synthesis happens based on what the LLM outputs. If you want, I’m happy to share more details or some examples to get you going!
Sources: pipeline-llm/replacing_llm_output.py | Modifying LLM output before TTS | LiveKit Docs | Voice pipeline nodes | LiveKit Docs | livekit-agents/livekit/agents/voice/io.py