Skip to content

Full python wrapper for the elevenlabs API.

License

Notifications You must be signed in to change notification settings

juankysoriano/elevenlabslib

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

40 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

elevenlabslib

Python wrapper for the full elevenlabs API.

Installation

Just run pip install elevenlabslib, it's on pypi.

Usage

For a far more comprehensive example, check example.py.

Here is a very simple usage sample.

  • Retrieves a voice based on the name
  • Plays back (using the included playback functions that use sounddevice) all its samples (and the preview)
  • Generates and plays back a new audio
  • Deletes the newly created audio from the user history
from elevenlabslib import *

user = ElevenLabsUser("API_KEY")
voice = user.get_voices_by_name("Rachel")[0]  # This is a list because multiple voices can have the same name

voice.play_preview(playInBackground=False)

voice.generate_and_play_audio("Test.", playInBackground=False)

for historyItem in user.get_history_items():
    if historyItem.text == "Test.":
        # The first items are the newest, so we can stop as soon as we find one.
        historyItem.delete()
        break

About

Full python wrapper for the elevenlabs API.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%