Skip to main content

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

kokoro_manim_voiceover-0.1.1.tar.gz (8.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

kokoro_manim_voiceover-0.1.1-py3-none-any.whl (8.6 kB view details)

Uploaded Python 3

File details

Details for the file kokoro_manim_voiceover-0.1.1.tar.gz.

File metadata

  • Download URL: kokoro_manim_voiceover-0.1.1.tar.gz
  • Upload date:
  • Size: 8.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for kokoro_manim_voiceover-0.1.1.tar.gz
Algorithm Hash digest
SHA256 510979a25c613b948e695152ca6e6236d7899b9eeb4bd759bb2ffa8bfdf58189
MD5 d42c113b66e42ac99f908c01b764bb95
BLAKE2b-256 df388137a07c44f94a3ddd5fd3ac247408b1582ddd4c4e12858aee5546bd03a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for kokoro_manim_voiceover-0.1.1.tar.gz:

Publisher: publish.yml on nkayzai/kokoro-manim-voiceover

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file kokoro_manim_voiceover-0.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for kokoro_manim_voiceover-0.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 74c998cbdb2f472467048e5190e84beecabdc778bab3b52fa92d2f29ac293f6b
MD5 96a1dd4b75704cbaf29c17f3e7edcbcf
BLAKE2b-256 e47e4a2dbe623587d343c2fa495cd5881f60c7e0224bb320a5f3c6d418b3ad49

See more details on using hashes here.

Provenance

The following attestation bundles were made for kokoro_manim_voiceover-0.1.1-py3-none-any.whl:

Publisher: publish.yml on nkayzai/kokoro-manim-voiceover

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page