Giter Club home page Giter Club logo

audiobook-generation's Introduction

Experimenting with AI generated Audiobooks using GPT4 and ElevenLabs TTS

The input text can be placed in the input.txt file. GPT4 is then used to provide a character summary with names and attributes, as well as the text in a manuscript format. The character attributes are then compared with the attributes from a set of ElevenLabs voices, and the most appropriate voice is chosen for each character. The transcribed text is then read line by line using TTS by either the narrator or the character who is speaking.

Usage

Put the text you want to transcribe in input.txt, and run

python main.py --transcribe --play

You need to have both an OpenAI API key and an ElevenLabs API key. You will also need to create voices with labels used in the code such that they can be matched with the characters.

export OPENAI_API_KEY="your_openai_api_key_here"
export ELEVENLABS_API_KEY="your_elevenlabs_api_key_here"

The labels used in this project are {'sex': 'male/female', 'age': 'young/old', 'accent': 'british/american/irish/scottish/indian'}, but you can change these as you like.

You can set the narrator voice in main.py to any voice you like by giving it the voice_id.

Options

The following options are available when running main.py:

  • --transcribe: Transcribes the input text and saves it to transcript.txt.
  • --play: Reads the transcribed text line by line using TTS.
  • --introduce: Provides a brief introduction of the characters using TTS.

Free Alternative to ElevenLabs

I'm experimenting with using Tortoise TTS as a free alternative to ElevenLabs that can be run locally. However, the inference is really slow in comparison.

TODO

  • Truncate the transcription for faster TTS generations.
  • Run TTS API calls in the background while previous TTS is playing.

audiobook-generation's People

Contributors

prosti221 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.