Professional library for generating high-quality voiceovers in Manim animations using Kokoro-82M model
Project description
Kokoro Manim Voiceover
Professional library for generating high-quality voiceovers in Manim animations using the Kokoro-82M model.
Installation
From PyPI (Recommended)
pip install kokoro-manim-voiceover
Using uv (Alternative)
# For new projects
uv init my-project
cd my-project
uv add kokoro-manim-voiceover
# Or install directly
uv pip install kokoro-manim-voiceover
Note: uv is a modern, high-performance Python package manager that offers significantly faster installations and better dependency resolution than pip. It's fully compatible with existing Python workflows.
From Source
git clone https://github.com/nkayzai/kokoro-manim-voiceover.git
cd kokoro-manim-voiceover
pip install -e .
Quick Start
from manim import *
from manim_voiceover import VoiceoverScene
from kokoro_mv import KokoroService
class MyAnimation(VoiceoverScene):
def construct(self):
self.set_speech_service(KokoroService(voice="af"))
with self.voiceover(text="Hello, this is my first voiceover!") as tracker:
self.play(Write(Text("Hello, this is my first voiceover!")), run_time=tracker.duration)
Available Voices
| Voice Code | Description |
|---|---|
af |
American Female (default) |
af_bella |
American Female - Bella |
af_nicole |
American Female - Nicole |
af_sarah |
American Female - Sarah |
af_sky |
American Female - Sky |
am_adam |
American Male - Adam |
am_michael |
American Male - Michael |
bf_emma |
British Female - Emma |
bf_isabella |
British Female - Isabella |
bm_george |
British Male - George |
bm_lewis |
British Male - Lewis |
Usage Examples
Basic Animation
class BasicExample(VoiceoverScene):
def construct(self):
self.set_speech_service(KokoroService(voice="af"))
circle = Circle()
square = Square().shift(2 * RIGHT)
with self.voiceover(text="This circle is drawn as I speak.") as tracker:
self.play(Create(circle), run_time=tracker.duration)
with self.voiceover(text="Now let's transform it into a square.") as tracker:
self.play(Transform(circle, square), run_time=tracker.duration)
Custom Configuration
service = KokoroService(
voice="am_michael", # Male voice
speed=1.2, # 20% faster
lang="en-us" # Language setting
)
Requirements
- Python 3.11+
- Dependencies are automatically installed
Model Files
The library automatically downloads required model files (~220MB) on first use.
Development
Setting up development environment
Using uv (Recommended)
# Clone the repository
git clone https://github.com/nkayzai/kokoro-manim-voiceover.git
cd kokoro-manim-voiceover
# Install in development mode with all dependencies
uv sync --dev
# Run tests
uv run pytest
# Format code
uv run black .
uv run isort .
# Type checking
uv run mypy .
Using pip
# Clone the repository
git clone https://github.com/nkayzai/kokoro-manim-voiceover.git
cd kokoro-manim-voiceover
# Create virtual environment
python -m venv venv
source venv/bin/activate # On Windows: venv\Scripts\activate
# Install in development mode
pip install -e ".[dev]"
# Run tests
pytest
# Format code
black .
isort .
License
MIT License
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file kokoro_manim_voiceover-0.1.2.tar.gz.
File metadata
- Download URL: kokoro_manim_voiceover-0.1.2.tar.gz
- Upload date:
- Size: 8.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a5e51e3397b3d7abdb24ae2881119135debdc98c5e9f3d039ec3f1e667376e59
|
|
| MD5 |
80845ee28452e176160d99eccd2abe39
|
|
| BLAKE2b-256 |
6799a7b3a59c01aa4e5de4acefb451fe3dce39a6014a1efc538e0a1029cf3e0f
|
Provenance
The following attestation bundles were made for kokoro_manim_voiceover-0.1.2.tar.gz:
Publisher:
publish.yml on nkayzai/kokoro-manim-voiceover
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kokoro_manim_voiceover-0.1.2.tar.gz -
Subject digest:
a5e51e3397b3d7abdb24ae2881119135debdc98c5e9f3d039ec3f1e667376e59 - Sigstore transparency entry: 492492490
- Sigstore integration time:
-
Permalink:
nkayzai/kokoro-manim-voiceover@5a8ece7754aeb7a184146f4f18bf548900f07980 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nkayzai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a8ece7754aeb7a184146f4f18bf548900f07980 -
Trigger Event:
push
-
Statement type:
File details
Details for the file kokoro_manim_voiceover-0.1.2-py3-none-any.whl.
File metadata
- Download URL: kokoro_manim_voiceover-0.1.2-py3-none-any.whl
- Upload date:
- Size: 8.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
11fb28d6bf5c3f8901e3ee9cfc21b86d255910ff4da3c4cd07857d4c321d55c8
|
|
| MD5 |
40bfddfe35e470980cf5fc02d277aa82
|
|
| BLAKE2b-256 |
8a534bedd6b6225ee07fca3de77ef44e8d9272565fb26b072f449813e8cdf9a1
|
Provenance
The following attestation bundles were made for kokoro_manim_voiceover-0.1.2-py3-none-any.whl:
Publisher:
publish.yml on nkayzai/kokoro-manim-voiceover
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
kokoro_manim_voiceover-0.1.2-py3-none-any.whl -
Subject digest:
11fb28d6bf5c3f8901e3ee9cfc21b86d255910ff4da3c4cd07857d4c321d55c8 - Sigstore transparency entry: 492492505
- Sigstore integration time:
-
Permalink:
nkayzai/kokoro-manim-voiceover@5a8ece7754aeb7a184146f4f18bf548900f07980 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/nkayzai
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@5a8ece7754aeb7a184146f4f18bf548900f07980 -
Trigger Event:
push
-
Statement type: