livekit-plugins-google 0.11.1__py3-none-any.whl → 0.11.3__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/stt.py +2 -3
- livekit/plugins/google/tts.py +15 -4
- livekit/plugins/google/version.py +1 -1
- {livekit_plugins_google-0.11.1.dist-info → livekit_plugins_google-0.11.3.dist-info}/METADATA +2 -2
- {livekit_plugins_google-0.11.1.dist-info → livekit_plugins_google-0.11.3.dist-info}/RECORD +7 -7
- {livekit_plugins_google-0.11.1.dist-info → livekit_plugins_google-0.11.3.dist-info}/WHEEL +1 -1
- {livekit_plugins_google-0.11.1.dist-info → livekit_plugins_google-0.11.3.dist-info}/top_level.txt +0 -0
livekit/plugins/google/stt.py
CHANGED
@@ -94,7 +94,7 @@ class STT(stt.STT):
|
|
94
94
|
punctuate: bool = True,
|
95
95
|
spoken_punctuation: bool = False,
|
96
96
|
model: SpeechModels | str = "latest_long",
|
97
|
-
location: str = "
|
97
|
+
location: str = "global",
|
98
98
|
sample_rate: int = 16000,
|
99
99
|
credentials_info: dict | None = None,
|
100
100
|
credentials_file: str | None = None,
|
@@ -114,7 +114,7 @@ class STT(stt.STT):
|
|
114
114
|
punctuate(bool): whether to punctuate the audio (default: True)
|
115
115
|
spoken_punctuation(bool): whether to use spoken punctuation (default: False)
|
116
116
|
model(SpeechModels): the model to use for recognition default: "latest_long"
|
117
|
-
location(str): the location to use for recognition default: "
|
117
|
+
location(str): the location to use for recognition default: "global"
|
118
118
|
sample_rate(int): the sample rate of the audio default: 16000
|
119
119
|
credentials_info(dict): the credentials info to use for recognition (default: None)
|
120
120
|
credentials_file(str): the credentials file to use for recognition (default: None)
|
@@ -488,7 +488,6 @@ class SpeechStream(stt.SpeechStream):
|
|
488
488
|
),
|
489
489
|
),
|
490
490
|
streaming_features=cloud_speech.StreamingRecognitionFeatures(
|
491
|
-
enable_voice_activity_events=True,
|
492
491
|
interim_results=self._config.interim_results,
|
493
492
|
),
|
494
493
|
)
|
livekit/plugins/google/tts.py
CHANGED
@@ -26,6 +26,7 @@ from livekit.agents import (
|
|
26
26
|
utils,
|
27
27
|
)
|
28
28
|
|
29
|
+
from google.api_core.client_options import ClientOptions
|
29
30
|
from google.api_core.exceptions import DeadlineExceeded, GoogleAPICallError
|
30
31
|
from google.cloud import texttospeech
|
31
32
|
from google.cloud.texttospeech_v1.types import SsmlVoiceGender, SynthesizeSpeechResponse
|
@@ -50,6 +51,7 @@ class TTS(tts.TTS):
|
|
50
51
|
pitch: int = 0,
|
51
52
|
effects_profile_id: str = "",
|
52
53
|
speaking_rate: float = 1.0,
|
54
|
+
location: str = "global",
|
53
55
|
credentials_info: dict | None = None,
|
54
56
|
credentials_file: str | None = None,
|
55
57
|
) -> None:
|
@@ -65,6 +67,7 @@ class TTS(tts.TTS):
|
|
65
67
|
gender (Gender | str, optional): Voice gender ("male", "female", "neutral"). Default is "neutral".
|
66
68
|
voice_name (str, optional): Specific voice name. Default is an empty string.
|
67
69
|
sample_rate (int, optional): Audio sample rate in Hz. Default is 24000.
|
70
|
+
location (str, optional): Location for the TTS client. Default is "global".
|
68
71
|
pitch (float, optional): Speaking pitch, ranging from -20.0 to 20.0 semitones relative to the original pitch. Default is 0.
|
69
72
|
effects_profile_id (str): Optional identifier for selecting audio effects profiles to apply to the synthesized speech.
|
70
73
|
speaking_rate (float, optional): Speed of speech. Default is 1.0.
|
@@ -83,7 +86,7 @@ class TTS(tts.TTS):
|
|
83
86
|
self._client: texttospeech.TextToSpeechAsyncClient | None = None
|
84
87
|
self._credentials_info = credentials_info
|
85
88
|
self._credentials_file = credentials_file
|
86
|
-
|
89
|
+
self._location = location
|
87
90
|
voice = texttospeech.VoiceSelectionParams(
|
88
91
|
name=voice_name,
|
89
92
|
language_code=language,
|
@@ -126,22 +129,30 @@ class TTS(tts.TTS):
|
|
126
129
|
self._opts.audio_config.speaking_rate = speaking_rate
|
127
130
|
|
128
131
|
def _ensure_client(self) -> texttospeech.TextToSpeechAsyncClient:
|
132
|
+
api_endpoint = "texttospeech.googleapis.com"
|
133
|
+
if self._location != "global":
|
134
|
+
api_endpoint = f"{self._location}-texttospeech.googleapis.com"
|
135
|
+
|
129
136
|
if self._client is None:
|
130
137
|
if self._credentials_info:
|
131
138
|
self._client = (
|
132
139
|
texttospeech.TextToSpeechAsyncClient.from_service_account_info(
|
133
|
-
self._credentials_info
|
140
|
+
self._credentials_info,
|
141
|
+
client_options=ClientOptions(api_endpoint=api_endpoint),
|
134
142
|
)
|
135
143
|
)
|
136
144
|
|
137
145
|
elif self._credentials_file:
|
138
146
|
self._client = (
|
139
147
|
texttospeech.TextToSpeechAsyncClient.from_service_account_file(
|
140
|
-
self._credentials_file
|
148
|
+
self._credentials_file,
|
149
|
+
client_options=ClientOptions(api_endpoint=api_endpoint),
|
141
150
|
)
|
142
151
|
)
|
143
152
|
else:
|
144
|
-
self._client = texttospeech.TextToSpeechAsyncClient(
|
153
|
+
self._client = texttospeech.TextToSpeechAsyncClient(
|
154
|
+
client_options=ClientOptions(api_endpoint=api_endpoint)
|
155
|
+
)
|
145
156
|
|
146
157
|
assert self._client is not None
|
147
158
|
return self._client
|
@@ -4,15 +4,15 @@ livekit/plugins/google/llm.py,sha256=LZaHsrkjfboRZLWm7L2G0mw62q2sXBNj4YeeV2Sk2uU
|
|
4
4
|
livekit/plugins/google/log.py,sha256=GI3YWN5YzrafnUccljzPRS_ZALkMNk1i21IRnTl2vNA,69
|
5
5
|
livekit/plugins/google/models.py,sha256=SGjAumdDK97NNLwMFcqZdKR68f1NoGB2Rk1UP2-imG0,1457
|
6
6
|
livekit/plugins/google/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
7
|
-
livekit/plugins/google/stt.py,sha256=
|
8
|
-
livekit/plugins/google/tts.py,sha256=
|
9
|
-
livekit/plugins/google/version.py,sha256=
|
7
|
+
livekit/plugins/google/stt.py,sha256=l6UB9oaM7eFInnI_0t7Ub-edXLVRgvaiyHj-e_gEuwE,22781
|
8
|
+
livekit/plugins/google/tts.py,sha256=t4a6so5mR6HxrZa3In_PxD37voIxs1fRL4F9Zu5qltE,8645
|
9
|
+
livekit/plugins/google/version.py,sha256=_Let6gsoyIgPmq62suQfckCl_Qx9L10STGT9OrmzGp0,601
|
10
10
|
livekit/plugins/google/beta/__init__.py,sha256=AxRYc7NGG62Tv1MmcZVCDHNvlhbC86hM-_yP01Qb28k,47
|
11
11
|
livekit/plugins/google/beta/realtime/__init__.py,sha256=sGTn6JFNyA30QUXBZ_BV3l2eHpGAzR35ByXxg77vWNU,205
|
12
12
|
livekit/plugins/google/beta/realtime/api_proto.py,sha256=9EhmwgeIgKDqdSijv5Q9pgx7UhAakK02ZDwbnUsra_o,657
|
13
13
|
livekit/plugins/google/beta/realtime/realtime_api.py,sha256=8JdWUMUheGhy1ia6JbN3_U2_cL7CNs8-1fTOAgW4I38,22999
|
14
14
|
livekit/plugins/google/beta/realtime/transcriber.py,sha256=rjXO0cSPr3HATxrSfv1MX7IbrjmiTvnLPF280BfRBL8,9809
|
15
|
-
livekit_plugins_google-0.11.
|
16
|
-
livekit_plugins_google-0.11.
|
17
|
-
livekit_plugins_google-0.11.
|
18
|
-
livekit_plugins_google-0.11.
|
15
|
+
livekit_plugins_google-0.11.3.dist-info/METADATA,sha256=LAZ-OoQF5_QUi5qe-STwxDiJ_mVDz2VxW1FyyUHwI6k,3732
|
16
|
+
livekit_plugins_google-0.11.3.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
17
|
+
livekit_plugins_google-0.11.3.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
18
|
+
livekit_plugins_google-0.11.3.dist-info/RECORD,,
|
{livekit_plugins_google-0.11.1.dist-info → livekit_plugins_google-0.11.3.dist-info}/top_level.txt
RENAMED
File without changes
|