livekit-plugins-elevenlabs 1.0.0rc5__py3-none-any.whl → 1.0.0rc6__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.
@@ -10,4 +10,12 @@ TTSModels = Literal[
10
10
  "eleven_flash_v2",
11
11
  ]
12
12
 
13
- TTSEncoding = Literal["mp3_44100",]
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
+ ]
@@ -44,7 +44,9 @@ from livekit.agents.utils import is_given
44
44
  from .log import logger
45
45
  from .models import TTSEncoding, TTSModels
46
46
 
47
- _DefaultEncoding: TTSEncoding = "mp3_44100"
47
+ # by default, use 22.05kHz sample rate at 32kbps
48
+ # in our testing, reduce TTFB by about ~110ms
49
+ _DefaultEncoding: TTSEncoding = "mp3_22050_32"
48
50
 
49
51
 
50
52
  def _sample_rate_from_format(output_format: TTSEncoding) -> int:
@@ -109,6 +111,7 @@ class TTS(tts.TTS):
109
111
  *,
110
112
  voice: Voice = DEFAULT_VOICE,
111
113
  model: TTSModels | str = "eleven_flash_v2_5",
114
+ encoding: NotGivenOr[TTSEncoding] = NOT_GIVEN,
112
115
  api_key: NotGivenOr[str] = NOT_GIVEN,
113
116
  base_url: NotGivenOr[str] = NOT_GIVEN,
114
117
  streaming_latency: NotGivenOr[int] = NOT_GIVEN,
@@ -138,11 +141,15 @@ class TTS(tts.TTS):
138
141
 
139
142
  if not is_given(chunk_length_schedule):
140
143
  chunk_length_schedule = [80, 120, 200, 260]
144
+
145
+ if not is_given(encoding):
146
+ encoding = _DefaultEncoding
147
+
141
148
  super().__init__(
142
149
  capabilities=tts.TTSCapabilities(
143
150
  streaming=True,
144
151
  ),
145
- sample_rate=_sample_rate_from_format(_DefaultEncoding),
152
+ sample_rate=_sample_rate_from_format(encoding),
146
153
  num_channels=1,
147
154
  )
148
155
 
@@ -162,7 +169,7 @@ class TTS(tts.TTS):
162
169
  model=model,
163
170
  api_key=elevenlabs_api_key,
164
171
  base_url=base_url if is_given(base_url) else API_BASE_URL_V1,
165
- encoding=_DefaultEncoding,
172
+ encoding=encoding,
166
173
  sample_rate=self.sample_rate,
167
174
  streaming_latency=streaming_latency,
168
175
  word_tokenizer=word_tokenizer,
@@ -12,4 +12,4 @@
12
12
  # See the License for the specific language governing permissions and
13
13
  # limitations under the License.
14
14
 
15
- __version__ = '1.0.0.rc5'
15
+ __version__ = '1.0.0.rc6'
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: livekit-plugins-elevenlabs
3
- Version: 1.0.0rc5
3
+ Version: 1.0.0rc6
4
4
  Summary: Agent Framework plugin for voice synthesis with ElevenLabs' API.
5
5
  Project-URL: Documentation, https://docs.livekit.io
6
6
  Project-URL: Website, https://livekit.io/
@@ -18,7 +18,7 @@ Classifier: Topic :: Multimedia :: Sound/Audio
18
18
  Classifier: Topic :: Multimedia :: Video
19
19
  Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
20
20
  Requires-Python: >=3.9.0
21
- Requires-Dist: livekit-agents[codecs]>=1.0.0.rc5
21
+ Requires-Dist: livekit-agents[codecs]>=1.0.0.rc6
22
22
  Description-Content-Type: text/markdown
23
23
 
24
24
  # LiveKit Plugins Elevenlabs
@@ -0,0 +1,9 @@
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=rrCtSEJT9MUk1wb-xJLcbmDmJNyXVOn8WN6eS8ATYRA,19783
6
+ livekit/plugins/elevenlabs/version.py,sha256=PDOEKN5zsYLQdbfAm5Di6G1sFYANNA0LqJR8zZzeghg,604
7
+ livekit_plugins_elevenlabs-1.0.0rc6.dist-info/METADATA,sha256=4yStd0XSGz__4IH-VCKJT3xPELN3qH-tOOW1iqUz9d4,1319
8
+ livekit_plugins_elevenlabs-1.0.0rc6.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
+ livekit_plugins_elevenlabs-1.0.0rc6.dist-info/RECORD,,
@@ -1,9 +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=NrW-xONOPOHXycmX9mL1m0wrQjwfb_3ZIxy9Jf0oVf4,19568
6
- livekit/plugins/elevenlabs/version.py,sha256=G8-S67mIdz56XcVImzUB7osx6o_lG2oShZz-PjWeOeo,604
7
- livekit_plugins_elevenlabs-1.0.0rc5.dist-info/METADATA,sha256=b3oikl-SpSYhHiBAhmW4r-N6pRF6M5_r7EKvQtQ-zQU,1319
8
- livekit_plugins_elevenlabs-1.0.0rc5.dist-info/WHEEL,sha256=qtCwoSJWgHk21S1Kb4ihdzI2rlJ1ZKaIurTj_ngOhyQ,87
9
- livekit_plugins_elevenlabs-1.0.0rc5.dist-info/RECORD,,