livekit-plugins-elevenlabs 0.8.1__py3-none-any.whl → 0.8.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/elevenlabs/models.py +9 -1
- livekit/plugins/elevenlabs/tts.py +9 -3
- livekit/plugins/elevenlabs/version.py +1 -1
- {livekit_plugins_elevenlabs-0.8.1.dist-info → livekit_plugins_elevenlabs-0.8.2.dist-info}/METADATA +2 -2
- livekit_plugins_elevenlabs-0.8.2.dist-info/RECORD +10 -0
- {livekit_plugins_elevenlabs-0.8.1.dist-info → livekit_plugins_elevenlabs-0.8.2.dist-info}/WHEEL +1 -1
- livekit_plugins_elevenlabs-0.8.1.dist-info/RECORD +0 -10
- {livekit_plugins_elevenlabs-0.8.1.dist-info → livekit_plugins_elevenlabs-0.8.2.dist-info}/top_level.txt +0 -0
@@ -10,4 +10,12 @@ TTSModels = Literal[
|
|
10
10
|
"eleven_flash_v2",
|
11
11
|
]
|
12
12
|
|
13
|
-
TTSEncoding = Literal[
|
13
|
+
TTSEncoding = Literal[
|
14
|
+
"mp3_22050_32",
|
15
|
+
"mp3_44100",
|
16
|
+
"mp3_44100_32",
|
17
|
+
"mp3_44100_64",
|
18
|
+
"mp3_44100_96",
|
19
|
+
"mp3_44100_128",
|
20
|
+
"mp3_44100_192",
|
21
|
+
]
|
@@ -37,7 +37,9 @@ from livekit.agents import (
|
|
37
37
|
from .log import logger
|
38
38
|
from .models import TTSEncoding, TTSModels
|
39
39
|
|
40
|
-
|
40
|
+
# by default, use 22.05kHz sample rate at 32kbps
|
41
|
+
# in our testing, reduce TTFB by about ~110ms
|
42
|
+
_DefaultEncoding: TTSEncoding = "mp3_22050_32"
|
41
43
|
|
42
44
|
|
43
45
|
def _sample_rate_from_format(output_format: TTSEncoding) -> int:
|
@@ -102,6 +104,7 @@ class TTS(tts.TTS):
|
|
102
104
|
*,
|
103
105
|
voice: Voice = DEFAULT_VOICE,
|
104
106
|
model: TTSModels | str = "eleven_flash_v2_5",
|
107
|
+
encoding: TTSEncoding | None = None,
|
105
108
|
api_key: str | None = None,
|
106
109
|
base_url: str | None = None,
|
107
110
|
streaming_latency: int = 0,
|
@@ -131,11 +134,14 @@ class TTS(tts.TTS):
|
|
131
134
|
language (str | None): Language code for the TTS model, as of 10/24/24 only valid for "eleven_turbo_v2_5". Optional.
|
132
135
|
"""
|
133
136
|
|
137
|
+
if not encoding:
|
138
|
+
encoding = _DefaultEncoding
|
139
|
+
|
134
140
|
super().__init__(
|
135
141
|
capabilities=tts.TTSCapabilities(
|
136
142
|
streaming=True,
|
137
143
|
),
|
138
|
-
sample_rate=_sample_rate_from_format(
|
144
|
+
sample_rate=_sample_rate_from_format(encoding),
|
139
145
|
num_channels=1,
|
140
146
|
)
|
141
147
|
|
@@ -161,7 +167,7 @@ class TTS(tts.TTS):
|
|
161
167
|
model=model,
|
162
168
|
api_key=api_key,
|
163
169
|
base_url=base_url or API_BASE_URL_V1,
|
164
|
-
encoding=
|
170
|
+
encoding=encoding,
|
165
171
|
sample_rate=self.sample_rate,
|
166
172
|
streaming_latency=streaming_latency,
|
167
173
|
word_tokenizer=word_tokenizer,
|
@@ -0,0 +1,10 @@
|
|
1
|
+
livekit/plugins/elevenlabs/__init__.py,sha256=YZVadomFq3JWiZN6GWXJbuE4vaNNWq1CmdH25du8qwg,1249
|
2
|
+
livekit/plugins/elevenlabs/log.py,sha256=hIuXqDsEB5GBa7rQY3z4Uqi1oCqc_lRmCHZEmXz0LHw,73
|
3
|
+
livekit/plugins/elevenlabs/models.py,sha256=p_wHEz15bdsNEqwzN831ysm70PNWQ-xeN__BKvGPZxA,401
|
4
|
+
livekit/plugins/elevenlabs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
+
livekit/plugins/elevenlabs/tts.py,sha256=ipXJdSYMKBd8mzTL3JfvYdRc2sJJRASOPPh2Ppy8NBk,19529
|
6
|
+
livekit/plugins/elevenlabs/version.py,sha256=qwktN8wnyHMjA3ewh43aDIBBwMd3jorNpCaoGTqBDrw,600
|
7
|
+
livekit_plugins_elevenlabs-0.8.2.dist-info/METADATA,sha256=mOzHe4OynY-A7OK1hi1OK4eXTnMRvKGG0CYjW_kXz0s,1529
|
8
|
+
livekit_plugins_elevenlabs-0.8.2.dist-info/WHEEL,sha256=CmyFI0kx5cdEMTLiONQRbGQwjIoR1aIYB7eCAQ4KPJ0,91
|
9
|
+
livekit_plugins_elevenlabs-0.8.2.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
10
|
+
livekit_plugins_elevenlabs-0.8.2.dist-info/RECORD,,
|
@@ -1,10 +0,0 @@
|
|
1
|
-
livekit/plugins/elevenlabs/__init__.py,sha256=YZVadomFq3JWiZN6GWXJbuE4vaNNWq1CmdH25du8qwg,1249
|
2
|
-
livekit/plugins/elevenlabs/log.py,sha256=hIuXqDsEB5GBa7rQY3z4Uqi1oCqc_lRmCHZEmXz0LHw,73
|
3
|
-
livekit/plugins/elevenlabs/models.py,sha256=nB43wLS1ilzS7IxLYVSQxBjKPnbiPl4AHpHAOlG2i00,273
|
4
|
-
livekit/plugins/elevenlabs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
5
|
-
livekit/plugins/elevenlabs/tts.py,sha256=-w8IeAvyQER4PLraajJz6OWDufvKpD_fPM8oPsYtX9s,19335
|
6
|
-
livekit/plugins/elevenlabs/version.py,sha256=PoHw-_DNE2B5SpeoQ-r6HSfVmbDgYuGamg0dN2jhayQ,600
|
7
|
-
livekit_plugins_elevenlabs-0.8.1.dist-info/METADATA,sha256=l8gbEDr8EsedqYQiqBhx6K9XwAdTtnQWVCxmlyjVG9w,1529
|
8
|
-
livekit_plugins_elevenlabs-0.8.1.dist-info/WHEEL,sha256=beeZ86-EfXScwlR_HKu4SllMC9wUEj_8Z_4FJ3egI2w,91
|
9
|
-
livekit_plugins_elevenlabs-0.8.1.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
|
10
|
-
livekit_plugins_elevenlabs-0.8.1.dist-info/RECORD,,
|
File without changes
|