<@U08CKJH7C12> i am using custom tts in livekit..b...
# agents
a
@refined-appointment-81829 i am using custom tts in livekit..by testing using livekit UI it produces tick sound when it playback the tts response. what could be the possible reasons ? i am using 0.1x version of agent and this is my agent configuration agent = VoicePipelineAgent( vad=ctx.proc.userdata["vad"], stt=myClass(), llm=openai.LLM( base_url="http://localhost:8080", ), tts=xtts.TTS( api_key="dummy", voice=xtts.Voice( id="v2", name="default", category="neural", settings=None ) ), chat_ctx=initial_ctx, )
r
The issue of a "tick" sound during TTS playback in your LiveKit setup could be caused by several factors. Here are some potential reasons and solutions to consider: 1. Audio Buffering Issues: If the audio is not being buffered correctly, it can lead to artifacts such as ticks or pops. Ensure that your audio processing pipeline is correctly handling the audio data, and consider increasing the buffer size if possible. 2. Silence Detection: If your Voice Activity Detection (VAD) is not configured properly, it might be introducing silence or noise at the beginning or end of the audio playback. Make sure your VAD settings are optimized for your use case. 3. TTS Configuration: Check the configuration of your custom TTS. If the TTS engine is not properly set up or if there are issues with the voice settings, it might produce unexpected sounds. Ensure that the voice settings are compatible with the TTS engine you are using. 4. Audio Format Compatibility: Ensure that the audio format being produced by your TTS engine is compatible with the playback system. Mismatched formats can lead to playback issues. You might want to check if the TTS output is in a format that is expected by the LiveKit audio pipeline. 5. Network Latency: If your TTS service is remote and there is significant network latency, it could cause delays in audio playback that might manifest as ticks. Consider testing the TTS locally to see if the issue persists. 6. Agent Version: Since you mentioned you are using version 0.1x of the agent, ensure that you are using the latest stable version, as there may have been bug fixes or improvements related to audio playback in newer versions. Here’s a sample configuration for your
VoicePipelineAgent
that you can use as a reference:
Copy code
agent = VoicePipelineAgent(
    vad=ctx.proc.userdata["vad"],
    stt=myClass(),
    llm=openai.LLM(
        base_url="http://localhost:8080",
    ),
    tts=xtts.TTS(
        api_key="dummy",
        voice=xtts.Voice(
            id="v2",
            name="default",
            category="neural",
            settings=None
        )
    ),
    chat_ctx=initial_ctx,
)
Make sure to test each of these aspects to identify the source of the tick sound during playback. If the problem persists after checking these areas, you may want to look into the specific implementation details of your TTS engine and how it integrates with LiveKit. References • livekit-examples/cartesia-voice-agent/agent/main.py#L50-L115 • livekit/agents-js/plugins/openai/src/tts.test.ts#L1-L11 • livekit/agents/examples/voice_agents/structured_output.py#L57-L112 • https://github.com/livekit/agents/blob/main/examples/voice_agents/structured_output.py#L57-L112 • https://github.com/livekit/agents-js/blob/main/plugins/openai/src/tts.test.ts#L1-L11 • https://github.com/livekit-examples/cartesia-voice-agent/blob/main/agent/main.py#L50-L115
✅ 1