Skip to content

Commit f441290

Browse files
committed
merged remote
2 parents cc95fb0 + 0eb5908 commit f441290

File tree

938 files changed

+69468
-23213
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

938 files changed

+69468
-23213
lines changed

.fernignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,9 @@
44
src/elevenlabs/client.py
55
src/elevenlabs/conversational_ai/conversation.py
66
src/elevenlabs/conversational_ai/default_audio_interface.py
7-
src/elevenlabs/play.py
87
src/elevenlabs/realtime_tts.py
8+
src/elevenlabs/play.py
9+
src/elevenlabs/webhooks_custom.py
910

1011
# Ignore CI files
1112
.github/

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
dist/
21
.mypy_cache/
2+
.ruff_cache/
33
__pycache__/
4+
dist/
45
poetry.toml
5-
.ruff_cache/

README.md

Lines changed: 26 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -8,37 +8,41 @@
88
[![PyPI - Python Version](https://img.shields.io/pypi/v/elevenlabs?style=flat&colorA=black&colorB=black)](https://pypi.org/project/elevenlabs/)
99
[![Downloads](https://static.pepy.tech/personalized-badge/elevenlabs?period=total&units=international_system&left_color=black&right_color=black&left_text=Downloads)](https://pepy.tech/project/elevenlabs)
1010

11-
The official Python API for [ElevenLabs](https://elevenlabs.io/) [text-to-speech software.](https://elevenlabs.io/text-to-speech) Eleven brings the most compelling, rich and lifelike voices to creators and developers in just a few lines of code.
11+
The official Python SDK for [ElevenLabs](https://elevenlabs.io/). ElevenLabs brings the most compelling, rich and lifelike voices to creators and developers in just a few lines of code.
1212

1313
## 📖 API & Docs
1414

1515
Check out the [HTTP API documentation](https://elevenlabs.io/docs/api-reference).
1616

17-
## ⚙️ Install
17+
## Install
1818

1919
```bash
2020
pip install elevenlabs
2121
```
2222

23-
## 🗣️ Usage
24-
25-
[![Open in Spaces](https://img.shields.io/badge/🤗-Open%20in%20Spaces-blue.svg)](https://huggingface.co/spaces/elevenlabs/tts)
26-
[![Open In Colab](https://colab.research.google.com/assets/colab-badge.svg)](https://colab.research.google.com/gist/flavioschneider/49468d728a816c6538fd2f56b3b50b96/elevenlabs-python.ipynb)
23+
## Usage
2724

2825
### Main Models
2926

3027
1. **Eleven Multilingual v2** (`eleven_multilingual_v2`)
3128

32-
- Excels in stability, language diversity, and accent accuracy
33-
- Supports 29 languages
34-
- Recommended for most use cases
29+
- Excels in stability, language diversity, and accent accuracy
30+
- Supports 29 languages
31+
- Recommended for most use cases
32+
33+
2. **Eleven Flash v2.5** (`eleven_flash_v2_5`)
34+
35+
- Ultra-low latency
36+
- Supports 32 languages
37+
- Faster model, 50% lower price per character
3538

3639
2. **Eleven Turbo v2.5** (`eleven_turbo_v2_5`)
37-
- High quality, lowest latency
38-
- Ideal for developer use cases where speed is crucial
39-
- Supports 32 languages
4040

41-
For more detailed information about these models and others, visit the [ElevenLabs Models documentation](https://elevenlabs.io/docs/speech-synthesis/models).
41+
- Good balance of quality and latency
42+
- Ideal for developer use cases where speed is crucial
43+
- Supports 32 languages
44+
45+
For more detailed information about these models and others, visit the [ElevenLabs Models documentation](https://elevenlabs.io/docs/models).
4246

4347
```py
4448
from dotenv import load_dotenv
@@ -65,7 +69,7 @@ play(audio)
6569

6670
</details>
6771

68-
## 🗣️ Voices
72+
## Voices
6973

7074
List all your available voices with `voices()`.
7175

@@ -76,7 +80,7 @@ client = ElevenLabs(
7680
api_key="YOUR_API_KEY",
7781
)
7882

79-
response = client.voices.get_all()
83+
response = client.voices.search()
8084
print(response.voices)
8185
```
8286

@@ -96,17 +100,17 @@ from elevenlabs.client import ElevenLabs
96100
from elevenlabs import play
97101

98102
client = ElevenLabs(
99-
api_key="YOUR_API_KEY", # Defaults ELEVENLABS_API_KEY
103+
api_key="YOUR_API_KEY",
100104
)
101105

102-
voice = client.clone(
106+
voice = client.voices.ivc.create(
103107
name="Alex",
104108
description="An old American male voice with a slight hoarseness in his throat. Perfect for news", # Optional
105109
files=["./sample_0.mp3", "./sample_1.mp3", "./sample_2.mp3"],
106110
)
107111
```
108112

109-
## 🚿 Streaming
113+
## Streaming
110114

111115
Stream audio in real-time, as it's being generated.
112116

@@ -116,7 +120,7 @@ from elevenlabs.client import ElevenLabs
116120

117121
client = ElevenLabs()
118122

119-
audio_stream = client.text_to_speech.convert_as_stream(
123+
audio_stream = client.text_to_speech.stream(
120124
text="This is a test",
121125
voice_id="JBFqnCBsd6RMkjVDRZzb",
122126
model_id="eleven_multilingual_v2"
@@ -132,32 +136,6 @@ for chunk in audio_stream:
132136

133137
```
134138

135-
### Input streaming
136-
137-
Stream text chunks into audio as it's being generated, with <1s latency. Note: if chunks don't end with space or punctuation (" ", ".", "?", "!"), the stream will wait for more text.
138-
139-
```py
140-
from elevenlabs.client import ElevenLabs
141-
from elevenlabs import stream
142-
143-
client = ElevenLabs(
144-
api_key="YOUR_API_KEY", # Defaults to ELEVENLABS_API_KEY
145-
)
146-
147-
def text_stream():
148-
yield "Hi there, I'm Eleven "
149-
yield "I'm a text to speech API "
150-
151-
audio_stream = client.generate(
152-
text=text_stream(),
153-
voice="Brian",
154-
model="eleven_multilingual_v2",
155-
stream=True
156-
)
157-
158-
stream(audio_stream)
159-
```
160-
161139
## Async Client
162140

163141
Use `AsyncElevenLabs` if you want to make API calls asynchronously.
@@ -168,21 +146,19 @@ import asyncio
168146
from elevenlabs.client import AsyncElevenLabs
169147

170148
eleven = AsyncElevenLabs(
171-
api_key="MY_API_KEY" # Defaults to ELEVENLABS_API_KEY
149+
api_key="MY_API_KEY"
172150
)
173151

174152
async def print_models() -> None:
175-
models = await eleven.models.get_all()
153+
models = await eleven.models.list()
176154
print(models)
177155

178156
asyncio.run(print_models())
179157
```
180158

181159
## Languages Supported
182160

183-
We support 32 languages and 100+ accents. Explore [all languages](https://elevenlabs.io/languages).
184-
185-
<img src="https://github.com/elevenlabs/elevenlabs-js/blob/main/assets/languages.png" width="900">
161+
Explore [all models & languages](https://elevenlabs.io/docs/models).
186162

187163
## Contributing
188164

0 commit comments

Comments
 (0)