Skip to content

Commit

Permalink
fix in CI
Browse files Browse the repository at this point in the history
  • Loading branch information
AngeloGiacco committed Feb 17, 2025
1 parent ca24caa commit 4b002d8
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/elevenlabs/realtime_tts.py
Original file line number Diff line number Diff line change
Expand Up @@ -236,10 +236,9 @@ def get_text() -> typing.Iterator[str]:
data = dict(text=text_chunk, try_trigger_generation=True)
await socket.send(json.dumps(data))
try:
async with asyncio.timeout(1e-2):
data = json.loads(await socket.recv())
if "audio" in data and data["audio"]:
yield base64.b64decode(data["audio"]) # type: ignore
async with json.loads(await asyncio.wait_for(socket.recv(), timeout=1e-2)):
if "audio" in data and data["audio"]:
yield base64.b64decode(data["audio"]) # type: ignore
except TimeoutError:
pass

Expand Down

0 comments on commit 4b002d8

Please sign in to comment.