Skip to main content

Manim Speech

Manim plugin for adding speech to videos.

Special thanks to osolmaz and others who worked on Manim Voiceover, which Manim Speech is heavily based on.

Installation

Manim Speech can be installed via pip using the following command:

pip install "manim_speech[*optional_dependency_sets*]"

Where *optional_dependency_sets* is a list of optional dependency sets for Manim Speech.

Features

  • Integrate voiceovers into Manim animations.

    • Utilize bookmarks to pause for key moments in the voiceover (identical to Manim Voiceover functionality).
  • Easily translate text within Manim animations to various languages with minimal code.

  • Leverage AI-driven services for text-to-speech, speech-to-text, and translation.

    • Easily utilize services that are not officially supported by subclassing TTSService, STTService, and TranslationService.

Services

Service Name Optional Dependency Set Is Local Text-To-Speech Speech-To-Text Translation
OpenAI openai No* Yes Yes No
ElevenLabs elevenlabs No Yes Yes No
Whisper whisper Yes No Yes No
AssemblyAI assemblyai No No Yes No
DeepL deepl No No No Yes

* The OpenAI service can use any backend compatible with the OpenAI API through the base_url parameter, some of which are local (e.g., LocalAI).

Note: This package previously included special procedures for Chinese translations as DeepL formerly did not natively support translating to Traditional Chinese. As they have since added support for Traditional Chinese, the special procedures and the relevant optional dependencies have been removed from this package.

Usage Examples

Creating a basic scene with a voiceover with Manim Speech:

import manim
from manim_speech import VoiceoverScene
from manim_speech.services.openai import OpenAISTTService, OpenAITTSService


class MeaningOfLife(VoiceoverScene):
    def construct(self) -> None:
        self.set_tts_service(OpenAITTSService())
        self.set_stt_service(OpenAISTTService())

        txt_question = manim.Text("What is the meaning of life?")
        txt_answer = manim.Text("The meaning of life is 42.")

        with self.voiceover("What is the meaning of life?<bookmark mark='reveal_answer' /> The meaning of life is 42."):
            self.play(manim.Write(txt_question), run_time=1.0)
            self.wait_until_bookmark("reveal_answer")
            self.play(manim.ReplacementTransform(txt_question, txt_answer), run_time=1.0)
            self.wait_for_voiceover()

The same scene, but translated into Traditional Chinese:

import manim
from manim_speech import TranslationScene, VoiceoverScene
from manim_speech.services.deepl import DeepLTranslationService
from manim_speech.services.openai import OpenAISTTService, OpenAITTSService

class MeaningOfLife(VoiceoverScene, TranslationScene):
    def construct(self) -> None:
        self.set_tts_service(OpenAITTSService())
        self.set_stt_service(OpenAISTTService())
        self.set_translation_service(DeepLTranslationService())

        self.translate(__file__, "meaning_of_life", "en", "zh-HANT")
        _ = self._

        txt_question = manim.Text(_("What is the meaning of life?"))
        txt_answer = manim.Text(_("The meaning of life is 42."))

        with self.voiceover(_("What is the meaning of life?<bookmark mark='reveal_answer' /> The meaning of life is 42.")):
            self.play(manim.Write(txt_question), run_time=1.0)
            self.wait_until_bookmark("reveal_answer")
            self.play(manim.ReplacementTransform(txt_question, txt_answer), run_time=1.0)
            self.wait_for_voiceover()

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

manim_speech-0.3.0.tar.gz (7.6 kB view details)

Uploaded Source

Built Distribution

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

manim_speech-0.3.0-py3-none-any.whl (12.2 kB view details)

Uploaded Python 3

File details

Details for the file manim_speech-0.3.0.tar.gz.

File metadata

  • Download URL: manim_speech-0.3.0.tar.gz
  • Upload date:
  • Size: 7.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for manim_speech-0.3.0.tar.gz
Algorithm Hash digest
SHA256 dd97ba87eaa47b96ddf875b1e44862b710a1e9a77f23d1d13b08addd8a58c7d3
MD5 a586f63d5f670911ef644f9120cd78ba
BLAKE2b-256 11046f8123921d069810b1d69d53db79e64e709c16b0d029c5c4ddcf990b1ef6

See more details on using hashes here.

File details

Details for the file manim_speech-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: manim_speech-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 12.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.0 {"installer":{"name":"uv","version":"0.12.0","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for manim_speech-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 33b4f606f654012ff97b8b1f2f3ac429ef9f3ccf606c255550f1cb8abb3347a1
MD5 705316fa620ff31aced5e4c011412d0f
BLAKE2b-256 3efb262a9d45925c1803933beb9518d344286978c7aec9dda5b7d7da424f763a

See more details on using hashes here.

Supported by

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