livekit-plugins-elevenlabs 0.1.3__py3-none-any.whl → 0.1.5__py3-none-any.whl
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- livekit/plugins/elevenlabs/tts.py +21 -2
- livekit/plugins/elevenlabs/version.py +1 -1
- {livekit_plugins_elevenlabs-0.1.3.dist-info → livekit_plugins_elevenlabs-0.1.5.dist-info}/METADATA +1 -1
- livekit_plugins_elevenlabs-0.1.5.dist-info/RECORD +8 -0
- livekit_plugins_elevenlabs-0.1.3.dist-info/RECORD +0 -8
- {livekit_plugins_elevenlabs-0.1.3.dist-info → livekit_plugins_elevenlabs-0.1.5.dist-info}/WHEEL +0 -0
- {livekit_plugins_elevenlabs-0.1.3.dist-info → livekit_plugins_elevenlabs-0.1.5.dist-info}/top_level.txt +0 -0
@@ -184,6 +184,7 @@ class SynthesizeStream(tts.SynthesizeStream):
|
|
184
184
|
retry_count = 0
|
185
185
|
listen_task: Optional[asyncio.Task] = None
|
186
186
|
ws: Optional[aiohttp.ClientWebSocketResponse] = None
|
187
|
+
retry_text_queue: asyncio.Queue[str] = asyncio.Queue()
|
187
188
|
while True:
|
188
189
|
try:
|
189
190
|
ws = await self._try_connect()
|
@@ -194,7 +195,13 @@ class SynthesizeStream(tts.SynthesizeStream):
|
|
194
195
|
# forward queued text to 11labs
|
195
196
|
started = False
|
196
197
|
while not ws.closed:
|
197
|
-
text =
|
198
|
+
text = None
|
199
|
+
if not retry_text_queue.empty():
|
200
|
+
text = await retry_text_queue.get()
|
201
|
+
retry_text_queue.task_done()
|
202
|
+
else:
|
203
|
+
text = await self._queue.get()
|
204
|
+
|
198
205
|
if not started:
|
199
206
|
self._event_queue.put_nowait(
|
200
207
|
tts.SynthesisEvent(type=tts.SynthesisEventType.STARTED)
|
@@ -204,7 +211,19 @@ class SynthesizeStream(tts.SynthesizeStream):
|
|
204
211
|
text=text,
|
205
212
|
try_trigger_generation=True,
|
206
213
|
)
|
207
|
-
|
214
|
+
|
215
|
+
# This case can happen in normal operation because 11labs will not
|
216
|
+
# keep connections open indefinitely if we are not sending data.
|
217
|
+
try:
|
218
|
+
await ws.send_str(json.dumps(text_packet))
|
219
|
+
except Exception:
|
220
|
+
await retry_text_queue.put(text)
|
221
|
+
break
|
222
|
+
|
223
|
+
# We call self._queue.task_done() even if we are retrying the text because
|
224
|
+
# all text has gone through self._queue. An exception may have short-circuited
|
225
|
+
# out of the loop so task_done() will not have already been called on text that
|
226
|
+
# is being retried.
|
208
227
|
self._queue.task_done()
|
209
228
|
if text == STREAM_EOS:
|
210
229
|
await listen_task
|
@@ -0,0 +1,8 @@
|
|
1
|
+
livekit/plugins/elevenlabs/__init__.py,sha256=-FQ-hnTqqbaVFa0sEu8CwInVp9vzkt-nRWkd34ruFFk,977
|
2
|
+
livekit/plugins/elevenlabs/models.py,sha256=g46mCMMHP3x3qtHmybHHMcid1UwmjKCcF0T4IWjMjWE,163
|
3
|
+
livekit/plugins/elevenlabs/tts.py,sha256=L9k2jttTbkcv7qsKiamdR75MRGT3EfSQ7L6k-pkhDeY,11114
|
4
|
+
livekit/plugins/elevenlabs/version.py,sha256=I8f9sRyhy7trGTK3-bCHGNvYPnJsNtV8zeYXa6iyQxc,600
|
5
|
+
livekit_plugins_elevenlabs-0.1.5.dist-info/METADATA,sha256=bYrkpn7u9sFi9coZCC5-gMA0UA2xa64rtfM3lR2cz_A,1360
|
6
|
+
livekit_plugins_elevenlabs-0.1.5.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7
|
+
livekit_plugins_elevenlabs-0.1.5.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
8
|
+
livekit_plugins_elevenlabs-0.1.5.dist-info/RECORD,,
|
@@ -1,8 +0,0 @@
|
|
1
|
-
livekit/plugins/elevenlabs/__init__.py,sha256=-FQ-hnTqqbaVFa0sEu8CwInVp9vzkt-nRWkd34ruFFk,977
|
2
|
-
livekit/plugins/elevenlabs/models.py,sha256=g46mCMMHP3x3qtHmybHHMcid1UwmjKCcF0T4IWjMjWE,163
|
3
|
-
livekit/plugins/elevenlabs/tts.py,sha256=xfx22n3T85vyu0dAjObaPzaaJC7dFewU2ZLa47cIZhg,10160
|
4
|
-
livekit/plugins/elevenlabs/version.py,sha256=tpb8RDeB0haxcQ6bcP2ohrPerLn7AiijcHoutd5FqYg,600
|
5
|
-
livekit_plugins_elevenlabs-0.1.3.dist-info/METADATA,sha256=7f-98TJdfwIqJDHrICrppAo1o0gywcA8LoHWd-ETcAw,1360
|
6
|
-
livekit_plugins_elevenlabs-0.1.3.dist-info/WHEEL,sha256=oiQVh_5PnQM0E3gPdiz09WCNmwiHDMaGer_elqB3coM,92
|
7
|
-
livekit_plugins_elevenlabs-0.1.3.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
8
|
-
livekit_plugins_elevenlabs-0.1.3.dist-info/RECORD,,
|
{livekit_plugins_elevenlabs-0.1.3.dist-info → livekit_plugins_elevenlabs-0.1.5.dist-info}/WHEEL
RENAMED
File without changes
|
File without changes
|