Support Fluxion Engine
If you find this project useful, please consider supporting its development.
Support ProjectAdd AI-generated voiceovers to your Fluxion animations.
Install the voiceover plugin:
pip install fluxion-voiceoverfrom fluxion import *
from fluxion_voiceover import VoiceoverScene
class MyVoiceover(VoiceoverScene):
def construct(self):
with self.voiceover(text="Welcome to Fluxion!") as tracker:
circle = Circle()
self.play(Create(circle), run_time=tracker.duration)# Set voice
self.set_voice("en-US-Neural2-A") # Google Cloud TTSdef construct(self):
with self.voiceover("First sentence"):
self.play(Create(Circle()))
with self.voiceover("Second sentence"):
self.play(Create(Square()))with self.voiceover("This is timed") as tracker:
# Animation duration matches voiceover
self.play(animation, run_time=tracker.duration)Create voiceover_config.json:
{
"provider": "gtts",
"language": "en",
"speed": 1.0,
"cache_dir": "./voiceovers"
}Supported TTS providers:
class VoiceoverExample(VoiceoverScene):
def construct(self):
title = Text("Voiceover Demo")
with self.voiceover("This is a demonstration"):
self.play(Write(title))
with self.voiceover("Watch the circle appear"):
circle = Circle()
self.play(Create(circle))
with self.voiceover("And now it fades away"):
self.play(FadeOut(circle))If you find this project useful, please consider supporting its development.
Support Project