From 9784c41cb80c5c715f44b47c9f472ab9dea359ee Mon Sep 17 00:00:00 2001 From: xposed73 <46350409+xposed73@users.noreply.github.com> Date: Fri, 24 Jan 2025 18:35:30 +0530 Subject: [PATCH] Update README.md --- README.md | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 76e3cdb..51ce619 100644 --- a/README.md +++ b/README.md @@ -1,11 +1,42 @@ -Instial via PIP +#Instial via PIP ```shell pip install git+https://github.com/xposed73/kokoro-mv.git ``` -Instial via UV +#Instial via UV ```shell uv init -p 3.12 uv venv uv pip install git+https://github.com/xposed73/kokoro-mv.git ``` + + +#Example usage +```python +from manim import * +from manim_voiceover import VoiceoverScene +from kokoro_mv.koko import KokoroService + + +class KokoExample(VoiceoverScene): + def construct(self): + self.set_speech_service(KokoroService( + model_path="kokoro-v0_19.onnx", + voices_path="voices.bin", + 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="Let's shift it to the left 2 units.") as tracker: + self.play(circle.animate.shift(2 * LEFT), 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) + + self.wait() +```