red-optician-55467
11/10/2025, 3:35 PMtall-airline-16756
11/10/2025, 3:35 PMtall-airline-16756
11/10/2025, 3:36 PMaudio_encoding=texttospeech.AudioEncoding.OGG_OPUS explicitly, or are you using the default settings?
• Have you noticed any warning messages in your logs about the encoding falling back to PCM?
• If you could share the full error traceback, that would be super helpful to pinpoint where in the streaming process the EOF condition is happening.
Looking forward to your reply so we can work through this together! Sources: livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/tts.pyred-optician-55467
11/10/2025, 3:41 PMtall-airline-16756
11/10/2025, 3:42 PMaudio_encoding=texttospeech.AudioEncoding.OGG_OPUS in streaming mode can be a bit tricky, but don’t worry—we’ll work through it together! Here are a few common areas to check:
• Timeouts: It’s a good idea to make sure your conn_options.timeout is set high enough to handle longer text inputs. Sometimes, if the timeout is too short, the stream might end sooner than expected.
• Premature Input Stream Closure: Double-check that your text segments are queued correctly and that flush signals aren’t being sent too early during streaming.
• Network Stability: Sometimes, intermittent connectivity between your agent and the Google TTS API endpoint (texttospeech.googleapis.com) can cause issues, so it’s worth verifying your network connection.
• Stream Handling: Make sure that your input generator and response processing aren’t getting interrupted unexpectedly. For example, exceptions during the _run_stream method could result in incomplete audio streams.
If you continue to see this error, it might help to review your timeout settings and keep an eye on your logs for any DeadlineExceeded or GoogleAPICallError exceptions. These can offer clues about what’s causing the EOFError. Please feel free to reach out if you need any more help—I’m here to support you! Sources: livekit-plugins/livekit-plugins-hume/livekit/plugins/hume/tts.pyred-optician-55467
11/10/2025, 3:45 PMtall-airline-16756
11/10/2025, 3:46 PMstreaming_synthesize method. When an encoding like ALAW isn’t supported, the system kindly switches over to PCM (Pulse Code Modulation), which works smoothly with the streaming interface.
This fallback helps keep your audio stream running without a hitch. Just a heads-up, PCM is an uncompressed format, so it might use a bit more bandwidth compared to compressed formats like OPUS. If you have any questions or specific needs around audio encoding, please feel free to reach out—I’m here to help! Sources: livekit-plugins/livekit-plugins-resemble/README.md | Smallest AI TTS plugin guide | LiveKit docs | Real-time AI Models & Streaming | livekit/livekit_composite | DeepWikired-optician-55467
11/10/2025, 3:48 PMtall-airline-16756
11/10/2025, 3:49 PMred-optician-55467
11/10/2025, 4:25 PMtall-airline-16756
11/10/2025, 4:26 PMred-optician-55467
11/10/2025, 8:31 PMconn_options.timeout is set high enough to handle longer text inputs. Sometimes, if the timeout is too short, the stream might end sooner than expected.
How can I increase the timeout for the Google TTS provider on this context?tall-airline-16756
11/10/2025, 8:31 PMAPIConnectOptions class to set a custom timeout value. Here's a friendly example in Python that you might find useful:
from livekit.agents import APIConnectOptions
from livekit.plugins import google
# Initialize Google TTS
tts = google.TTS()
# Use a custom timeout (e.g., 10 seconds) for streaming
stream = tts.stream(conn_options=APIConnectOptions(timeout=10))
# Or for non-streaming synthesis
chunked_stream = tts.synthesize(text="Hello world", conn_options=APIConnectOptions(timeout=10))
This way, you can set the timeout to whatever value suits you best (like 10 seconds) for both streaming and non-streaming synthesis. If you have any questions or need a hand with anything else, please don’t hesitate to ask—I’m here to help! Sources: tests/test_tts.pyred-optician-55467
11/10/2025, 8:37 PMtall-airline-16756
11/10/2025, 8:38 PMconn_options parameter with a custom APIConnectOptions object. Here’s a friendly example to guide you:
from livekit.agents import AgentSession, APIConnectOptions
from livekit.plugins.google import TTS
from livekit.plugins.openai import LLM
from livekit.plugins.deepgram import STT
# Define your desired timeout (e.g., 30 seconds)
conn_options = APIConnectOptions(timeout=30.0)
# Initialize the TTS plugin with custom connection options
tts_plugin = TTS(conn_options=conn_options)
# Use the configured TTS in your AgentSession
agent_session = AgentSession(
agent=YourAgentClass(tts=tts_plugin, llm=LLM(), stt=STT()) # example setup
)
This way, both streaming and non-streaming TTS calls will honor the timeout you’ve set. If you have any questions or want to explore this further, I’m here to help! Sources: Google Cloud TTS integration guide | LiveKit docs | livekit-plugins/livekit-plugins-rime/livekit/plugins/rime/tts.pyred-optician-55467
11/10/2025, 8:49 PM{"message": "unhandled exception while running the job task\nTraceback (most recent call last):\n File \"/usr/local/lib/python3.10/site-packages/opentelemetry/ut
il/_decorator.py\", line 71, in async_wrapper\n return await func(*args, **kwargs) # type: ignore\n File \"/usr/local/lib/python3.10/site-packages/livekit/agents/ipc/job_proc_lazy_main.py\
", line 240, in _traceable_entrypoint\n await self._job_entrypoint_fnc(job_ctx)\n File \"/app/src/agent/main.py\", line 271, in agent_entrypoint\n primary_tts = TTS_CONFIGS.get(tts_provi
der_name.lower(), lambda _: None)(tts_config)\n File \"/app/src/agent/utils/providers_conf.py\", line 181, in \n \"google\": lambda tts_data: google.TTS(\nTypeError: TTS.__init__()
got an unexpected keyword argument 'conn_options'", "level": "ERROR", "name": "livekit.agents", "pid": 80, "job_id": "AJ_WfmmX7QEnftR", "timestamp": "2025-11-10T20:48:56.898390+00:00"}tall-airline-16756
11/10/2025, 8:50 PMconn_options parameter isn’t supported when you’re initializing the TTS class. Instead, you’ll want to pass conn_options when you call methods like .stream() or `.synthesize()`—this way, you can control the connection behavior smoothly.
Here’s a friendly example to guide you:
# Initialize TTS with the right parameters
tts = TTS(model="cartesia/sonic-2", voice="my_voice_id", api_key="my_api_key")
# Pass conn_options when you call stream or synthesize
stream = tts.stream(conn_options=APIConnectOptions(timeout=15))
This approach keeps your setup and connection settings nicely separated. If you have any questions or want me to walk you through it more, just let me know—I’m here to help! Sources: livekit-plugins/livekit-plugins-neuphonic/livekit/plugins/neuphonic/tts.pyred-optician-55467
11/10/2025, 8:51 PMtall-airline-16756
11/10/2025, 8:52 PMconn_options for Google TTS in a LiveKit pipeline agent using AgentSession, you can use the SessionConnectOptions class. Here’s a friendly example to guide you through it:
from livekit.agents.voice import AgentSession
from livekit.agents.types import SessionConnectOptions, APIConnectOptions
from livekit.plugins import google
# Define custom connection options for TTS
tts_conn_options = APIConnectOptions(
timeout=15.0, # Timeout for TTS requests
max_retries=5 # Maximum number of retry attempts
)
# Create SessionConnectOptions with TTS-specific settings
session_conn_options = SessionConnectOptions(
tts_conn_options=tts_conn_options,
max_unrecoverable_errors=5
)
# Initialize AgentSession with Google TTS and custom connection options
session = AgentSession(
tts=google.TTS(
gender="female",
voice_name="en-US-Standard-H",
sample_rate=24000,
speaking_rate=1.0,
volume_gain_db=0.0
),
conn_options=session_conn_options
)
This setup makes sure the timeout and other connection settings are tailored specifically for the TTS service. If you have any questions or want me to walk you through any part of this, just let me know—I’m here to help! Sources: livekit-plugins/livekit-plugins-google/livekit/plugins/google/realtime/real... | Google Cloud TTS integration guide | LiveKit docs