A Streamlit-based application that converts script files into voiceovers using the ElevenLabs API. The application allows you to assign different voices to characters in your script and automatically generates audio files for each dialogue line.
- Upload script files with character and dialogue markup
- Automatic character detection from script
- Voice assignment interface for each character
- Batch generation of audio files
- Progress tracking during generation
- Organized output with numbered audio files
- Built-in audio preview for generated files
- Download functionality for individual audio files
- File management with delete option for unwanted files
- Python 3.6+
- Streamlit
- Requests
- python-dotenv
- ElevenLabs API key
- Clone the repository:
git clone https://github.com/yourusername/voiceover-generator.git
cd voiceover-generator
- Install the required packages:
pip install -r requirements.txt
- Create a
.env
file from the template:
cp .env.template .env
- Add your ElevenLabs API key to the
.env
file:
ELEVENLABS_API_KEY=your_api_key_here
- Start the Streamlit application:
streamlit run app.py
- Upload a script file in the required format (see below)
- Assign voices to each character using the sidebar
- Click "Generate Voiceovers" to create audio files
- Preview, download, or delete generated audio files directly from the UI
- Find the generated audio files in the
output
directory
Scripts should be formatted using XML-style tags for characters and dialogue. Example:
<character>John</character>
<dialogue>Hello there! How are you doing today?</dialogue>
<character>Sarah</character>
<dialogue>I'm doing great, thanks for asking! How about you?</dialogue>
<character>John</character>
<dialogue>I'm fantastic! The weather is perfect for a walk in the park.</dialogue>
<character>Sarah</character>
<dialogue>You're right! We should definitely enjoy this beautiful day.</dialogue>
Generated audio files will be saved in the output
directory with the following naming convention:
001_Character.mp3
002_Character.mp3
...
Each generated audio file can be:
- Previewed directly in the browser using the built-in audio player
- Downloaded individually using the Download button
- Deleted if no longer needed using the Delete button
This project is licensed under the terms of the LICENSE file included in the repository.