11 labs TTS seems to intermittently fail. ```Trac...
# agents
c
11 labs TTS seems to intermittently fail.
Copy code
Traceback (most recent call last):
  File "/app/.venv/lib/python3.9/site-packages/livekit/agents/tts/tts.py", line 517, in __anext__
    val = await self._event_aiter.__anext__()
StopAsyncIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/app/.venv/lib/python3.9/site-packages/livekit/agents/tts/fallback_adapter.py", line 286, in _try_synthesize
    async for audio in stream:
  File "/app/.venv/lib/python3.9/site-packages/livekit/agents/tts/tts.py", line 520, in __anext__
    raise exc  # noqa: B904
  File "/app/.venv/lib/python3.9/site-packages/opentelemetry/util/_decorator.py", line 71, in async_wrapper
    return await func(*args, **kwargs)  # type: ignore
  File "/app/.venv/lib/python3.9/site-packages/livekit/agents/tts/tts.py", line 356, in _main_task
    raise APIError(f"no audio frames were pushed for text: {self._pushed_text}")
livekit.agents._exceptions.APIError: no audio frames were pushed for text: Great question!. (body=None, retryable=True)
Seems like nobody else has a resolution in the support threads yet.
e
Use google tts chirp hd voices, they are more or less same as 11labs . I am using google tts for my own product.
They have a concurrency limit which i think will be exhausted pretty quickly for a real prod apps unless you are on a higher tier.
c
We have the enterprise plan, I think this is a livekit bug
p
https://github.com/livekit/agents/issues/4135 -> Yes I had reported it here
c
Awesome, thanks
https://github.com/livekit/agents/pull/4182/files Does this fix the issue or does it just give more error messages? I am a bit confused
p
It doesn't fix the issue - It just gives an error message from 11labs. I have reported it on the comment. But seems like they want to check why this is happening first
m
Been seeing this alot lately
c
@enough-match-43171 is chirp more stable? How have your users reacted to it versus 11 labs?
e
Yeah, quality is similar to 11labs, you should try it.

https://youtu.be/ycp724pEnBQ▾

I have used chirp hd kore voice in this video.
j
please upgrade to agents and elevenlabs plugin >= 1.3.7, it should log the detailed error messages for us understanding what is the issue there
c
Now this is happening like 20% of the time..
There is definitely something wrong on livekit end bc I have been using 11 labs for quite some time and this was a rare issue
g
Was this ever solved? What was the root cause here. We are seeing similar issues with Rime
c
No it never got solved
It is still an issue
g
Wow okay, we saw it for almost all of our calls with Rime yesterday; oddly when I switched to Cartesia, the error rate went down
c
It's definitely on livekits side when they implement these APIs
But they don't know the cause yet
g
May also be best to coordinate with 11labs; there may be some backward compatibility issues (11labs updating the API which causes issues for the existing livekit connectors). Obviously, the solution is that the connector gets updated or 11labs does a reversion, but it would be good to know what versions of the connector is "bad"
m
Curious which livekit agent version u guys are using @cuddly-cartoon-47334 @glamorous-oil-12326
c
The latest
j
@cuddly-cartoon-47334 if you are using the latest version, can you share a full log for debugging, it should include the error message returned from the 11labs.
c
Okay. The next time I get this error I’ll share it. Hasn't happened yet since I updated (yesterday)
🙏 1
r
it looks like streaming TTS retries are broken. The retry loop reuses the same SynthesizeStream instance, but the _input_ch channel and plugin state are one-shot resources that get consumed during the first attempt. As a result, retrying the same request sends no text or produces no segments, leading to consistent failures like APIError: no audio frames were pushed or segments mismatch. I think this PR should fix that : https://github.com/livekit/agents/pull/4410 cc @jolly-air-155
🙌 1
j
@ripe-account-5250 thank for raising this, I have noticed the issue as well but I am not sure if it’s by design, here is my thoughts https://github.com/livekit/agents/issues/4409#issuecomment-3698032850