Skip to content

Commit

Permalink
Updated[001] GUI
Browse files Browse the repository at this point in the history
  • Loading branch information
avnlearn committed Sep 22, 2024
1 parent 605a31d commit b8eceb1
Show file tree
Hide file tree
Showing 10 changed files with 1,075 additions and 269 deletions.
82 changes: 82 additions & 0 deletions example/Example_1.ipynb
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
{
"cells": [
{
"cell_type": "code",
"execution_count": 16,
"metadata": {},
"outputs": [],
"source": [
"from manim import *\n"
]
},
{
"cell_type": "code",
"execution_count": 17,
"metadata": {},
"outputs": [
{
"data": {
"text/html": [
"<pre style=\"white-space:pre;overflow-x:auto;line-height:normal;font-family:Menlo,'DejaVu Sans Mono',consolas,'Courier New',monospace\">Manim Community <span style=\"color: #008000; text-decoration-color: #008000\">v0.18.1</span>\n",
"\n",
"</pre>\n"
],
"text/plain": [
"Manim Community \u001b[32mv0.\u001b[0m\u001b[32m18.1\u001b[0m\n",
"\n"
]
},
"metadata": {},
"output_type": "display_data"
},
{
"name": "stdout",
"output_type": "stream",
"text": [
"Yes\n"
]
},
{
"data": {
"image/png": "iVBORw0KGgoAAAANSUhEUgAABQAAAALQCAYAAADPfd1WAAAUgklEQVR4nO3YQQ0AIBDAsAP/nkEFIVlaBXtvzcwZAAAAACBp/w4AAAAAAN4xAAEAAAAgzAAEAAAAgDADEAAAAADCDEAAAAAACDMAAQAAACDMAAQAAACAMAMQAAAAAMIMQAAAAAAIMwABAAAAIMwABAAAAIAwAxAAAAAAwgxAAAAAAAgzAAEAAAAgzAAEAAAAgDADEAAAAADCDEAAAAAACDMAAQAAACDMAAQAAACAMAMQAAAAAMIMQAAAAAAIMwABAAAAIMwABAAAAIAwAxAAAAAAwgxAAAAAAAgzAAEAAAAgzAAEAAAAgDADEAAAAADCDEAAAAAACDMAAQAAACDMAAQAAACAMAMQAAAAAMIMQAAAAAAIMwABAAAAIMwABAAAAIAwAxAAAAAAwgxAAAAAAAgzAAEAAAAgzAAEAAAAgDADEAAAAADCDEAAAAA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ABAAAAIMwABAAAAICwC0cpBp8Rbaq9AAAAAElFTkSuQmCC",
"text/plain": [
"<IPython.core.display.Image object>"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%manim -qm -v WARNING VoiceRecorder\n",
"class VoiceRecorder(Scene):\n",
" def construct(self):\n",
" t = Text(\"Hello\")\n",
" p = Paragraph(\"Go\")\n",
" m = MarkupText(\"Yes\")\n",
" print(m.original_text)\n"
]
}
],
"metadata": {
"kernelspec": {
"display_name": ".venv",
"language": "python",
"name": "python3"
},
"language_info": {
"codemirror_mode": {
"name": "ipython",
"version": 3
},
"file_extension": ".py",
"mimetype": "text/x-python",
"name": "python",
"nbconvert_exporter": "python",
"pygments_lexer": "ipython3",
"version": "3.12.5"
}
},
"nbformat": 4,
"nbformat_minor": 2
}
40 changes: 15 additions & 25 deletions example/gui_example.py
Original file line number Diff line number Diff line change
@@ -1,42 +1,32 @@
from pprint import pp
from manim import *

from manim_recorder.voiceover_scene import RecorderScene
from manim_recorder.recorder.gui import RecorderService
from pathlib import Path


class VoiceRecorder(RecorderScene):
def construct(self):
# self.set_audio_service(RecorderService(), cache_dir_delete=True, skip=True)
self.set_audio_service(RecorderService(), cache_dir_delete=True)
# self.set_audio_service(RecorderService())

circle = Circle()
square = Square().shift(2 * RIGHT)
math = MathTex(r"x = \dfrac{-b \pm \sqrt{b^2 - 4ac}}{2a}")
m = VGroup(circle, square, math)
# self.say_to_image_play(Create(circle))
# self.say_to_image_play(Uncreate(circle))
# self.say_to_image_play(Write(math))
# self.say_to_image_play(Unwrite(math))
self.say_to_image_play(Write(m))
# print(Write(m).get_all_mobjects())
# self.say_to_play_image(Create(circle))
# self.say_to_image_play(Create(circle))

with self.voiceover(
"भारत के दस सबसे अधिक प्रतिभाशाली लेखक यह हमलोग नहीं जानना सकते है कि भुत्तकल(Past) में बहुत सारे लिखका हुए जो प्रतिभाशाली थे और आने वाले भाभिष्य कल (Future) में प्रतिभाशाली लेखक होगे। यह हम कुछ लेखको को देखेगे।, इसलिए लिखेगे", math
) as tracker:
self.play(Write(math), run_time=tracker.duration)

# self.play(Unwrite(math))

# with self.voiceover(math) as tracker:
# self.play(Write(math), run_time=tracker.duration)

# self.play(Unwrite(math))

# self.say_to_wait("This circle is drawn as I speak.", None, Create(circle))

self.say_to_play(Create(circle), text="This circle is drawn as I speak.", mobject=math)
# with self.voiceover(text="This circle is drawn as I speak.") as tracker:
# self.play(Create(circle), run_time=tracker.duration)

self.say_to_wait()
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)
self.wait()

with self.voiceover(text="Thank you for watching.") as tracker:
self.play(Uncreate(circle))

self.wait()
if __name__ == "__main__":
scene = VoiceRecorder()
scene.render()
96 changes: 63 additions & 33 deletions manim_recorder/helper.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,18 @@
import textwrap
import datetime
import platform # Added import for platform
import logging
from manim import logger, Mobject

from manim import (
logger,
Mobject,
Animation,
Text,
MarkupText,
Paragraph,
SingleStringMathTex,
VGroup,
Group,
)


def Check_os():
Expand Down Expand Up @@ -45,47 +55,67 @@ def get_audio_basename() -> str:
return "Voice_{}".format(now.strftime("%d%m%Y_%H%M%S"))


def mobject_to_text(mobject: Mobject) -> str():
# Tex() or MathTex()
if hasattr(mobject, "get_tex_string"):
mobject = mobject.get_tex_string()
# Text
elif hasattr(mobject, "original_text"):
mobject = mobject.original_text
# Paragraph
elif hasattr(mobject, "lines_text"):
mobject = mobject.lines_text.original_text
else:
mobject = str(mobject)
return mobject
def mobject_to_text(vmobject: Mobject) -> str():
if isinstance(vmobject, Animation):
return mobject_to_text(animation_to_mobject(vmobject))

match vmobject:
case SingleStringMathTex():
return vmobject.get_tex_string()
case MarkupText() | Text():
return vmobject.original_text
case Paragraph():
return mobject_to_text(vmobject.lines_text)
case VGroup() | Group():
m_str = []
for m in vmobject:
m = mobject_to_text(m)
if m:
m_str.append(m)
return "\n".join(m_str)
case _:
return str(vmobject)


def mobject_to_image(vmobject: Mobject, path=None) -> str():
if isinstance(vmobject, Animation):
vmobject = animation_to_mobject(vmobject)
try:
# save_image
# get_file_path
# get_image
return vmobject.get_image()
except Exception as e:
logger.error("animation object is not supported : {}".format(e))


def animation_to_mobject(vmobject):
try:
return vmobject.get_all_mobjects()[0]
except Exception as e:

logger.error("animation object is not supported : {}".format(e))


def text_and_mobject(text: str, mobject: Mobject, **kwargs) -> tuple():
match [text, mobject]:
case [None, Mobject()]:
case [None, Mobject() | Animation()]:
text = mobject_to_text(mobject)
mobject = (
mobject.get_file_path() if hasattr(mobject, "get_file_path") else None
)
case [str(), Mobject()]:
try:
mobject = (
mobject.get_file_path()
if hasattr(mobject, "get_file_path")
else None
)

except AttributeError as e:
logging.error("mobject : {}".format(e))
mobject = None
mobject = mobject_to_image(mobject)
case [str(), Mobject() | Animation()]:
mobject = mobject_to_image(mobject)
case [None, str()]:
text = mobject
mobject = mobject if os.path.exists(mobject) else None
case [Mobject(), None] | [Mobject(), str()] | [str(), None]:
case (
[Mobject() | Animation(), None]
| [Mobject() | Animation(), str()]
| [str(), None]
):
return text_and_mobject(mobject, text)
case _:
return None
return None, None

return text, mobject


Expand Down
8 changes: 4 additions & 4 deletions manim_recorder/multimedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@
import wave
import subprocess
import time
import logging
from pathlib import Path
import sox
import numpy as np
Expand Down Expand Up @@ -128,7 +127,8 @@ def set_device_index(self, device_index) -> None:
self.device_index = device_index
return True
except Exception as e:
logging.error("Invalid device index. Please try again. {}".format(e))

logger.error("Invalid device index. Please try again. {}".format(e))
return False

def set_channels(self, channels: int = None) -> None:
Expand All @@ -141,7 +141,7 @@ def set_channels(self, channels: int = None) -> None:
).get("maxInputChannels")
return True
except Exception as e:
logging.error("Invalid device index. Please try again. {}".format(e))
logger.error("Invalid device index. Please try again. {}".format(e))
return False

def get_device_count(self) -> int:
Expand Down Expand Up @@ -189,7 +189,7 @@ def _record(self) -> None:
self.append(data)
# self.append(audio_data.tobytes())
except Exception as e:
logging.error("An error occurred during recording: {}".format(e))
logger.error("An error occurred during recording: {}".format(e))
finally:
stream.stop_stream()
stream.close()
Expand Down
Loading

0 comments on commit b8eceb1

Please sign in to comment.