Skip to content

Commit f082e05

Browse files
committed
Run black, fix elevenlabs import issue
1 parent 575530b commit f082e05

File tree

4 files changed

+13
-22
lines changed

4 files changed

+13
-22
lines changed

examples/openai-example.py

+3-1
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ def construct(self):
2424
with self.voiceover(text="Now, let's transform it into a square.") as tracker:
2525
self.play(Transform(circle, square), run_time=tracker.duration)
2626

27-
with self.voiceover(text="Thank you for watching.", speed=0.75): # You can also change the audio speed by specifying the speed argument.
27+
with self.voiceover(
28+
text="Thank you for watching.", speed=0.75
29+
): # You can also change the audio speed by specifying the speed argument.
2830
self.play(Uncreate(circle))
2931

3032
self.wait()

examples/quadratic-formula-arabic.py

+5-15
Original file line numberDiff line numberDiff line change
@@ -384,9 +384,7 @@ def construct(self):
384384
self.play(FadeIn(equation, shift=DOWN))
385385
self.wait(0.2)
386386

387-
with self.voiceover(
388-
text="بِحَيْثُ a b c أَعْدَادٌ حَقِيقِيَّةٌ، وَ a غَيْر مُنْعَدِمٍ."
389-
) as tracker:
387+
with self.voiceover(text="بِحَيْثُ a b c أَعْدَادٌ حَقِيقِيَّةٌ، وَ a غَيْر مُنْعَدِمٍ.") as tracker:
390388
self.play(ReplacementTransform(equation[0].copy(), text))
391389

392390
self.wait()
@@ -399,9 +397,7 @@ def construct(self):
399397
with self.voiceover(text="نَقُومُ بِمُضَاعَفَةِ b، ") as tracker:
400398
self.play(TransformMatchingShapes(eq1, eq2, path_arc=PI / 3))
401399

402-
with self.voiceover(
403-
text=" وَنَقْسِمُهُ عَلَى 2، كَيْ نُحَافِظَ عَلَى الْمُعَادَلَةِ."
404-
) as tracker:
400+
with self.voiceover(text=" وَنَقْسِمُهُ عَلَى 2، كَيْ نُحَافِظَ عَلَى الْمُعَادَلَةِ.") as tracker:
405401
self.play(TransformMatchingShapes(eq2, eq3, path_arc=PI / 3))
406402
self.wait()
407403

@@ -436,9 +432,7 @@ def construct(self):
436432
TransformMatchingShapes(eq5[2:], eq6[4]),
437433
)
438434

439-
with self.voiceover(
440-
text="وَ الآنَ، تَعْمِيلُ الْمُتَطَابِقَةِ الْهَامَّةُ"
441-
) as tracker:
435+
with self.voiceover(text="وَ الآنَ، تَعْمِيلُ الْمُتَطَابِقَةِ الْهَامَّةُ") as tracker:
442436
self.play(Indicate(eq6[0:2], color=RED))
443437
self.wait(2)
444438

@@ -479,18 +473,14 @@ def construct(self):
479473
self.play(ind_eq92)
480474

481475
self.wait(0.3)
482-
with self.voiceover(
483-
text="نَضَعُ دِلْتَا يُسَاوِي الْبَسْطْ، b مُرَبَّعْ نَاقِصْ 4 a c."
484-
) as tracker:
476+
with self.voiceover(text="نَضَعُ دِلْتَا يُسَاوِي الْبَسْطْ، b مُرَبَّعْ نَاقِصْ 4 a c.") as tracker:
485477
self.play(
486478
TransformFromCopy(delta, onpose[1][2:8]),
487479
Write(VGroup(onpose[0], onpose[1][0:2], onpose[8:])),
488480
lag_ratio=0.5,
489481
)
490482
self.wait(0.3)
491-
with self.voiceover(
492-
text="دِلْتَا يُسَمَّى: مُمَيِّزُ الْمُعَادَلَةِ E"
493-
) as tracker:
483+
with self.voiceover(text="دِلْتَا يُسَمَّى: مُمَيِّزُ الْمُعَادَلَةِ E") as tracker:
494484
self.wait(tracker.duration)
495485
# TODO You have to color the solutions set and formulas for cases
496486

manim_voiceover/services/elevenlabs.py

+1-2
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,13 @@
99
from manim_voiceover.helper import create_dotenv_file
1010

1111
try:
12-
import elevenlabs
12+
from elevenlabs import Voice, VoiceSettings, generate, save, voices
1313
except ImportError:
1414
logger.error(
1515
'Missing packages. Run `pip install "manim-voiceover[elevenlabs]"` '
1616
"to use ElevenLabs API."
1717
)
1818

19-
from elevenlabs import Voice, VoiceSettings, generate, save, voices
2019

2120
from manim_voiceover.helper import create_dotenv_file, remove_bookmarks
2221
from manim_voiceover.services.base import SpeechService

manim_voiceover/services/openai.py

+4-4
Original file line numberDiff line numberDiff line change
@@ -54,11 +54,11 @@ def __init__(
5454
"""
5555
Args:
5656
voice (str, optional): The voice to use. See the
57-
`API page <https://platform.openai.com/docs/api-reference/audio/createSpeech>`__
58-
for all the available options. Defaults to ``"alloy"``.
57+
`API page <https://platform.openai.com/docs/api-reference/audio/createSpeech>`__
58+
for all the available options. Defaults to ``"alloy"``.
5959
model (str, optional): The TTS model to use.
60-
See the `API page <https://platform.openai.com/docs/api-reference/audio/createSpeech>`__
61-
for all the available options. Defaults to ``"tts-1-hd"``.
60+
See the `API page <https://platform.openai.com/docs/api-reference/audio/createSpeech>`__
61+
for all the available options. Defaults to ``"tts-1-hd"``.
6262
"""
6363
prompt_ask_missing_extras("openai", "openai", "OpenAIService")
6464
self.voice = voice

0 commit comments

Comments
 (0)