Giter VIP home page Giter VIP logo

eleven_labsrt's Introduction

Eleven_labsrt

This project helps you generate audio files using .srt (subtitle) files and ElevenLabs.

The idea is that it will first generate (and cache) all strings in your subtitles and then mix in the results in an audio file, respecting times as much as possible, for example if two subtitles overlap it will append them next to each other, never stripping any parts of the audio.

IMPORTANT NOTE: This project requires ffmpeg. Please follow the installation instructions for your operating system:

on mac with homebrew:

brew install ffmpeg

on Linux (using aptitude):

apt install ffmpeg

On windows you have several options like winget or chocolately. the easiest one is with winget if you have Windows 10 or 11.

winget install --id=Gyan.FFmpeg -e

Installation

First, install dependencies:

pip install -r requirements.txt

You will then need to obtain an ElevenLabs API key by registering for an account and paying for one of their plans (otherwise you are limited to a small number of characters).

To get your API key just go into the user dropdown and select Profile.

There is a modal dialog that pops up and your API key is in there, just create a .env file like this:

ELEVENLABS_API_KEY = xxxxxx

Where xxxxx is your API key.

Usage

This is a command line app which accepts the following arguments:

Documentation for Command Line Arguments

This application accepts several command line arguments to customize its behavior. Here is a brief description of each:

  • -l, --list-voices: This flag, when specified, lists all available voices from your ElevenLabs account, excluding default voices not cloned by you. Note that specifying this action does not convert anything.

  • -i, --input-file: This argument should be followed by the path to the input SRT file to be processed (-i 01.srt).

  • -o, --output-file: This argument should be followed by the path to the output mp3 file to generate. If not specified, the default is output.mp3.

  • -d, --debug: This flag, when specified, enables the debug or verbose mode.

  • -v, --voice: This argument should be followed by the name of the voice to use when converting subtitles. The voice must be a valid voice on the ElevenLabs user account whose API key is used. If no voice is specified, the app will bail out.

  • -q, --prefer-queue: This flag, when specified, places overlapping subtitles sequentially. If neither this nor --prefer-speedup is specified, the app will use this by default.

  • [WIP]-s, --prefer-speedup: This flag, when specified, prefers speeding up audio to fit overlapping subtitles. If neither --prefer-speedup nor --prefer-queue is specified, queue is used.

Generating only a set of subtitles

You can create a file called include.txt with the following format:

1
2
3

This is lines containing only single numbers which are subtitle indexes.

when you open this tool and this file is detected, you will be asked if you want to use this include file or generate the entire subtitle list.

eleven_labsrt's People

Contributors

ogomez92 avatar

Stargazers

Youssef Siam avatar  avatar  avatar le Duc Banal avatar Sylwester avatar samy kamkar avatar  avatar Alfred avatar Jose Antonio González Doñas avatar

Watchers

 avatar Sukil Etxenike avatar Alfred avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.