livekit-plugins-elevenlabs 0.7.6__py3-none-any.whl → 0.7.7__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.
@@ -87,6 +87,7 @@ class _TTSOptions:
87
87
  api_key: str
88
88
  voice: Voice
89
89
  model: TTSModels | str
90
+ language: str | None
90
91
  base_url: str
91
92
  encoding: TTSEncoding
92
93
  sample_rate: int
@@ -114,6 +115,7 @@ class TTS(tts.TTS):
114
115
  http_session: aiohttp.ClientSession | None = None,
115
116
  # deprecated
116
117
  model_id: TTSModels | str | None = None,
118
+ language: str | None = None,
117
119
  ) -> None:
118
120
  """
119
121
  Create a new instance of ElevenLabs TTS.
@@ -129,6 +131,7 @@ class TTS(tts.TTS):
129
131
  enable_ssml_parsing (bool): Enable SSML parsing for input text. Defaults to False.
130
132
  chunk_length_schedule (list[int]): Schedule for chunk lengths, ranging from 50 to 500. Defaults to [80, 120, 200, 260].
131
133
  http_session (aiohttp.ClientSession | None): Custom HTTP session for API requests. Optional.
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
 
134
137
  super().__init__(
@@ -162,6 +165,7 @@ class TTS(tts.TTS):
162
165
  word_tokenizer=word_tokenizer,
163
166
  chunk_length_schedule=chunk_length_schedule,
164
167
  enable_ssml_parsing=enable_ssml_parsing,
168
+ language=language,
165
169
  )
166
170
  self._session = http_session
167
171
 
@@ -523,8 +527,12 @@ def _stream_url(opts: _TTSOptions) -> str:
523
527
  output_format = opts.encoding
524
528
  latency = opts.streaming_latency
525
529
  enable_ssml = str(opts.enable_ssml_parsing).lower()
526
- return (
530
+ language = opts.language
531
+ url = (
527
532
  f"{base_url}/text-to-speech/{voice_id}/stream-input?"
528
533
  f"model_id={model_id}&output_format={output_format}&optimize_streaming_latency={latency}&"
529
534
  f"enable_ssml_parsing={enable_ssml}"
530
535
  )
536
+ if language is not None:
537
+ url += f"&language_code={language}"
538
+ return url
@@ -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__ = "0.7.6"
15
+ __version__ = "0.7.7"
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: livekit-plugins-elevenlabs
3
- Version: 0.7.6
3
+ Version: 0.7.7
4
4
  Summary: Agent Framework plugin for voice synthesis with ElevenLabs' API.
5
5
  Home-page: https://github.com/livekit/agents
6
6
  License: Apache-2.0
@@ -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=ddBUlDT4707f64WDJASR0B60X0yQ-LRHK1ZpTuBJXK8,387
4
+ livekit/plugins/elevenlabs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
+ livekit/plugins/elevenlabs/tts.py,sha256=GgpXXBumLW2r1vKGZ_k-k8rYCQJVahioPMr2aJeSWwk,18760
6
+ livekit/plugins/elevenlabs/version.py,sha256=78n--2R9Gwuh35Oy92hkYHXCMK_Er2s6VCfDuPQa2Ic,600
7
+ livekit_plugins_elevenlabs-0.7.7.dist-info/METADATA,sha256=nTXxc7ODYH7VljmXYPAeNUjMRTE20XB7fBl0micpQQ4,1305
8
+ livekit_plugins_elevenlabs-0.7.7.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
9
+ livekit_plugins_elevenlabs-0.7.7.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
10
+ livekit_plugins_elevenlabs-0.7.7.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=ddBUlDT4707f64WDJASR0B60X0yQ-LRHK1ZpTuBJXK8,387
4
- livekit/plugins/elevenlabs/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
5
- livekit/plugins/elevenlabs/tts.py,sha256=mxdypC-zSbS1R15FmztT49ssk_arkKGUPe_d5uVqOUk,18422
6
- livekit/plugins/elevenlabs/version.py,sha256=vOFNGWowZUhIrmyHBGtCx5dGhCp1T2FPt0h7KU_XKJg,600
7
- livekit_plugins_elevenlabs-0.7.6.dist-info/METADATA,sha256=DY1JbHdgfNivv0p0xA5ZRenYUGEYC33yX4TcNh__srg,1305
8
- livekit_plugins_elevenlabs-0.7.6.dist-info/WHEEL,sha256=P9jw-gEje8ByB7_hXoICnHtVCrEwMQh-630tKvQWehc,91
9
- livekit_plugins_elevenlabs-0.7.6.dist-info/top_level.txt,sha256=OoDok3xUmXbZRvOrfvvXB-Juu4DX79dlq188E19YHoo,8
10
- livekit_plugins_elevenlabs-0.7.6.dist-info/RECORD,,