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, andTranslationService.
- Easily utilize services that are not officially supported by subclassing
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()
Metadata
Release files for manim_speech 0.3.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 | |
|---|---|---|---|
| manim_speech-0.3.0.tar.gz | 7.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| manim_speech-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 19.7 kB
Release files / manim_speech-0.3.0.tar.gz
| Download URL | manim_speech-0.3.0.tar.gz |
|---|---|
| Size | 7.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
dd97ba87eaa47b96ddf875b1e44862b710a1e9a77f23d1d13b08addd8a58c7d3
|
|
BLAKE2b-256 checksum How to use checksums |
11046f8123921d069810b1d69d53db79e64e709c16b0d029c5c4ddcf990b1ef6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|
Release files / manim_speech-0.3.0-py3-none-any.whl
| Download URL | manim_speech-0.3.0-py3-none-any.whl |
|---|---|
| Size | 12.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
33b4f606f654012ff97b8b1f2f3ac429ef9f3ccf606c255550f1cb8abb3347a1
|
|
BLAKE2b-256 checksum How to use checksums |
3efb262a9d45925c1803933beb9518d344286978c7aec9dda5b7d7da424f763a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is 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}
|