Skip to main content

Manim plugin for recorder

Project description

Manim Recorder

GUI (Using PySide6)

GUI Recorder 1

GUI Recorder 1

GUI Recorder 1

from manim import *
# from manim_recorder import VoiceoverScene
from manim_recorder.voiceover_scene import RecorderScene
# from manim_recorder.services.recorder import RecorderService
from manim_recorder.recorder.gui import RecorderService


class VoiceRecorder(RecorderScene):
    def construct(self):
        self.set_audio_service(
            RecorderService()
        )

        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="Thank you for watching.") as tracker:
            self.play(Uncreate(circle))

        self.wait()

CLI (Pynput)

from manim import *
# from manim_recorder import VoiceoverScene
from manim_recorder.voiceover_scene import RecorderScene
# from manim_recorder.services.recorder import RecorderService
from manim_recorder.recorder.pynput import RecorderService
from pathlib import Path


class VoiceRecorder(RecorderScene):
    def construct(self):
        self.set_audio_service(
            RecorderService(
                device_index=0,
                # cache_dir=Path(
                #     config.media_dir + "/voiceovers/" + self.__class__.__name__.lower()
                # ),
            )
        )

        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="Thank you for watching.") as tracker:
            self.play(Uncreate(circle))

        self.wait()

Termux Cli

from manim import *
from manim_recorder.voiceover_scene import RecorderScene
from manim_recorder.recorder.termux import RecorderService
from pathlib import Path


class Recordering(RecorderScene):
    def construct(self):
        self.set_speech_service(
            RecorderService(
            )
        )

        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("This circle is drawn as I speak.") as tracker:
        #     self.safe_wait(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="Thank you for watching."):
            self.play(Uncreate(circle))

        self.wait()

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

manim_recorder-0.2.9.tar.gz (29.1 kB view details)

Uploaded Source

Built Distribution

manim_recorder-0.2.9-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file manim_recorder-0.2.9.tar.gz.

File metadata

  • Download URL: manim_recorder-0.2.9.tar.gz
  • Upload date:
  • Size: 29.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.9.20

File hashes

Hashes for manim_recorder-0.2.9.tar.gz
Algorithm Hash digest
SHA256 61b366e58532be489a00a4d4e3181d5a7ccbf7822594cfec9ce4b867bcc2d99d
MD5 ecbd2f9f444bc7c5c2f796ecee0322af
BLAKE2b-256 ed1336a9d84232c76b5a809c51fd9db43293626bbe365cb3d7c04ab9cd49763d

See more details on using hashes here.

File details

Details for the file manim_recorder-0.2.9-py3-none-any.whl.

File metadata

File hashes

Hashes for manim_recorder-0.2.9-py3-none-any.whl
Algorithm Hash digest
SHA256 437ac431a3252fd38804742c69e602c0c615c2ba4592471e3749ce5125132199
MD5 567b12aa5667f455cd7403b19c8b2d7b
BLAKE2b-256 afb719315fcfd204e1c9327e2bb5dd1a9e3fed16e95253e41720f49cdc96d04d

See more details on using hashes here.

Supported by

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