ElevenLabs Voice Isolator for Video Files
This tool extracts audio from video files and uses the ElevenLabs voice isolator API to remove background noise, resulting in clean, studio-quality speech.
Features
- Extract audio from various video formats (MP4, AVI, MOV, MKV, WebM)
- Process individual video files or batch process entire directories
- Isolate voice from background noise using ElevenLabs' AI
- Merge isolated voice audio back with original video
- Simple command-line interface
- Modular package structure for easy integration into other projects
Requirements
- Python 3.7+
- FFmpeg installed on your system
- ElevenLabs API key
Installation
Option 1: Install from source
- Clone this repository or download the files
- Install the package in development mode:
pip install -e .
Option 2: Install dependencies only
- Clone this repository or download the files
- Install the required Python packages:
pip install -r requirements.txt
-
Install FFmpeg if not already installed:
- macOS:
brew install ffmpeg - Ubuntu/Debian:
sudo apt-get install ffmpeg - Windows: Download from ffmpeg.org or use Chocolatey:
choco install ffmpeg
- macOS:
-
Create a
.envfile with your ElevenLabs API key:
cp .env.example .env
Then edit the .env file to add your API key.
Usage
Command-line Interface
The package provides a simple command-line interface:
# Process a single video
python cli.py path/to/video.mp4 -o path/to/output.mp4
# Batch process all videos in a directory
python cli.py path/to/videos_directory --batch -o path/to/output_directory
Python API
You can also use the package as a Python module in your own projects:
from voice_isolator.processor import process_video, batch_process_videos
# Process a single video
process_video(
video_path="path/to/video.mp4",
output_path="path/to/output.mp4",
api_key="your-elevenlabs-api-key" # Optional if set in environment
)
# Batch process videos
batch_process_videos(
input_dir="path/to/videos_directory",
output_dir="path/to/output_directory",
api_key="your-elevenlabs-api-key" # Optional if set in environment
)
Additional options
usage: cli.py [-h] [-o OUTPUT] [--batch] [--temp-dir TEMP_DIR] [--keep-temp] [--api-key API_KEY] [--video-codec VIDEO_CODEC] [--overwrite] [--verbose] input
Process videos with ElevenLabs voice isolation
positional arguments:
input Input video file or directory containing video files
optional arguments:
-h, --help show this help message and exit
-o OUTPUT, --output OUTPUT
Output file or directory for processed videos
--batch Process all video files in the input directory
--temp-dir TEMP_DIR Directory for temporary files (only used in batch mode)
--keep-temp Keep temporary files
--api-key API_KEY ElevenLabs API key (will use ELEVENLABS_API_KEY env var if not provided)
--video-codec VIDEO_CODEC
Video codec to use (default: copy - no re-encoding)
--overwrite Overwrite output files if they exist
--verbose Enable verbose logging
Package Structure
The package is organized into the following modules:
voice_isolator.audio.isolator: Functions for isolating voice from audio filesvoice_isolator.video.extractor: Functions for extracting audio from video filesvoice_isolator.video.merger: Functions for merging video files with audio filesvoice_isolator.processor: Main processing functions combining all componentsvoice_isolator.utils: Utility functions (logging, etc.)
How It Works
- The script extracts the audio track from the video file using FFmpeg
- The extracted audio is sent to the ElevenLabs voice isolator API
- The API processes the audio to remove background noise and isolate the voice
- The cleaned audio is merged back with the original video
- The final video with clean audio is saved to the specified output location
License
MIT
Acknowledgements
- ElevenLabs for their voice isolation API
- FFmpeg for audio/video processing capabilities
Metadata
Release files for elevenlabs-voice-isolator 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| elevenlabs_voice_isolator-0.1.0.tar.gz | 8.0 kB | Without provenance | Details for elevenlabs_voice_isolator-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| elevenlabs_voice_isolator-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for elevenlabs_voice_isolator-0.1.0-py3-none-any.whl |
Total release size: 19.9 kB
Release files / elevenlabs_voice_isolator-0.1.0.tar.gz
| Download URL | elevenlabs_voice_isolator-0.1.0.tar.gz |
|---|---|
| Size | 8.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c61e11d2c5ef6d841de495de02fa5cf678e44189ec25ba3c4ef5c9063cbcc221
|
|
BLAKE2b-256 checksum How to use checksums |
1bffaa19dbf35d464e708454bcdd2f9f563a8b20730f359f1a88d8067afb8deb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Release files / elevenlabs_voice_isolator-0.1.0-py3-none-any.whl
| Download URL | elevenlabs_voice_isolator-0.1.0-py3-none-any.whl |
|---|---|
| Size | 11.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
179109037e3f5b809a75b9330f5db1783642f2be6249130efcb67b96438a0db8
|
|
BLAKE2b-256 checksum How to use checksums |
8e5c96bbcf00bcab2245cb426356a12463b70741b5b51eaa7a8d637d6d56fa08
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.7
|
Security for elevenlabs-voice-isolator 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.