livekit-plugins-google 0.6.0.dev7__py3-none-any.whl → 0.6.2__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/google/__init__.py +3 -4
- livekit/plugins/google/stt.py +9 -8
- livekit/plugins/google/tts.py +1 -1
- livekit/plugins/google/version.py +1 -1
- {livekit_plugins_google-0.6.0.dev7.dist-info → livekit_plugins_google-0.6.2.dist-info}/METADATA +1 -1
- livekit_plugins_google-0.6.2.dist-info/RECORD +11 -0
- {livekit_plugins_google-0.6.0.dev7.dist-info → livekit_plugins_google-0.6.2.dist-info}/WHEEL +1 -1
- livekit_plugins_google-0.6.0.dev7.dist-info/RECORD +0 -11
- {livekit_plugins_google-0.6.0.dev7.dist-info → livekit_plugins_google-0.6.2.dist-info}/top_level.txt +0 -0
@@ -20,13 +20,12 @@ __all__ = ["STT", "TTS", "SpeechStream", "__version__"]
|
|
20
20
|
|
21
21
|
from livekit.agents import Plugin
|
22
22
|
|
23
|
+
from .log import logger
|
24
|
+
|
23
25
|
|
24
26
|
class GooglePlugin(Plugin):
|
25
27
|
def __init__(self):
|
26
|
-
super().__init__(__name__, __version__, __package__)
|
27
|
-
|
28
|
-
def download_files(self):
|
29
|
-
pass
|
28
|
+
super().__init__(__name__, __version__, __package__, logger)
|
30
29
|
|
31
30
|
|
32
31
|
Plugin.register_plugin(GooglePlugin())
|
livekit/plugins/google/stt.py
CHANGED
@@ -20,7 +20,7 @@ import os
|
|
20
20
|
from dataclasses import dataclass
|
21
21
|
from typing import AsyncIterable, List, Union
|
22
22
|
|
23
|
-
from livekit import agents
|
23
|
+
from livekit import agents, rtc
|
24
24
|
from livekit.agents import stt, utils
|
25
25
|
|
26
26
|
from google.cloud.speech_v2 import SpeechAsyncClient
|
@@ -212,7 +212,7 @@ class SpeechStream(stt.SpeechStream):
|
|
212
212
|
|
213
213
|
async def _run(self, max_retry: int) -> None:
|
214
214
|
retry_count = 0
|
215
|
-
while not self._input_ch.closed:
|
215
|
+
while self._input_ch.qsize() or not self._input_ch.closed:
|
216
216
|
try:
|
217
217
|
# google requires a async generator when calling streaming_recognize
|
218
218
|
# this function basically convert the queue into a async generator
|
@@ -225,12 +225,13 @@ class SpeechStream(stt.SpeechStream):
|
|
225
225
|
)
|
226
226
|
|
227
227
|
async for frame in self._input_ch:
|
228
|
-
frame
|
229
|
-
|
230
|
-
|
231
|
-
|
232
|
-
|
233
|
-
|
228
|
+
if isinstance(frame, rtc.AudioFrame):
|
229
|
+
frame = frame.remix_and_resample(
|
230
|
+
self._sample_rate, self._num_channels
|
231
|
+
)
|
232
|
+
yield cloud_speech.StreamingRecognizeRequest(
|
233
|
+
audio=frame.data.tobytes()
|
234
|
+
)
|
234
235
|
|
235
236
|
except Exception:
|
236
237
|
logger.exception(
|
livekit/plugins/google/tts.py
CHANGED
@@ -0,0 +1,11 @@
|
|
1
|
+
livekit/plugins/google/__init__.py,sha256=CYbSmm5fEw71F_r_4pEApGaWQ_r15Y3ZEocH88a4yc8,948
|
2
|
+
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
3
|
+
livekit/plugins/google/models.py,sha256=n8pgTJ7xyJpPCZJ_y0GzaQq6LqYknL6K6trpi07-AxM,1307
|
4
|
+
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
livekit/plugins/google/stt.py,sha256=Jt3_uc6F9rBZootKyPYslgCgusQB_k7NQ1Cvj9CwppI,12970
|
6
|
+
livekit/plugins/google/tts.py,sha256=jvbw-T-JlVxcYWiF-tCox35LZuCN3DBKwDp3zN8JCTw,5549
|
7
|
+
livekit/plugins/google/version.py,sha256=hj5La4IQz5ccAWt5oJAkV9TnNFuujYmxSTjcRby-kNQ,600
|
8
|
+
livekit_plugins_google-0.6.2.dist-info/METADATA,sha256=fvHmaZHNW-dAFBr8-G5Mrm1sHs66AY6Ur8rXvD2Q-rg,1584
|
9
|
+
livekit_plugins_google-0.6.2.dist-info/WHEEL,sha256=R0nc6qTxuoLk7ShA2_Y-UWkN8ZdfDBG2B6Eqpz2WXbs,91
|
10
|
+
livekit_plugins_google-0.6.2.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
11
|
+
livekit_plugins_google-0.6.2.dist-info/RECORD,,
|
@@ -1,11 +0,0 @@
|
|
1
|
-
livekit/plugins/google/__init__.py,sha256=DlQC5cosMFyQlM8_vFvJGoZiziFkd0Sa4mutnsxXyZM,959
|
2
|
-
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
3
|
-
livekit/plugins/google/models.py,sha256=n8pgTJ7xyJpPCZJ_y0GzaQq6LqYknL6K6trpi07-AxM,1307
|
4
|
-
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
livekit/plugins/google/stt.py,sha256=bqXaoi5trER7PE45axfEpHwReElmf7yl38RpK1iJsdc,12849
|
6
|
-
livekit/plugins/google/tts.py,sha256=KUw826CK3yt5meGVj0TKkueQ8o_gaXbc1Rtvdv2yF5M,5548
|
7
|
-
livekit/plugins/google/version.py,sha256=gME4gb-pAs4fqxf_ZCEZ61YUAVNBlNE6faURbcuEUOQ,606
|
8
|
-
livekit_plugins_google-0.6.0.dev7.dist-info/METADATA,sha256=HmTrKn7CnD70dS4j73sKJmEDu_GekjGAfKtoaGBL3gQ,1589
|
9
|
-
livekit_plugins_google-0.6.0.dev7.dist-info/WHEEL,sha256=Wyh-_nZ0DJYolHNn1_hMa4lM7uDedD_RGVwbmTjyItk,91
|
10
|
-
livekit_plugins_google-0.6.0.dev7.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
11
|
-
livekit_plugins_google-0.6.0.dev7.dist-info/RECORD,,
|
{livekit_plugins_google-0.6.0.dev7.dist-info → livekit_plugins_google-0.6.2.dist-info}/top_level.txt
RENAMED
File without changes
|