Skip to content

Commit

Permalink
Update README.md
Browse files Browse the repository at this point in the history
  • Loading branch information
xposed73 authored Jan 24, 2025
1 parent 68d185a commit 9784c41
Showing 1 changed file with 33 additions and 2 deletions.
35 changes: 33 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -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()
```

0 comments on commit 9784c41

Please sign in to comment.