frommanimimport*frommanim_voiceoverimportVoiceoverScenefrommanim_voiceover.services.recorderimportRecorderService# Simply inherit from VoiceoverScene instead of Scene to get all the# voiceover functionality.classRecorderExample(VoiceoverScene):defconstruct(self):# You can choose from a multitude of TTS services,# or in this example, record your own voice:self.set_speech_service(RecorderService())circle=Circle()# Surround animation sections with with-statements:withself.voiceover(text="This circle is drawn as I speak.")astracker:self.play(Create(circle),run_time=tracker.duration)# The duration of the animation is received from the audio file# and passed to the tracker automatically.# This part will not start playing until the previous voiceover is finished.withself.voiceover(text="Let's shift it to the left 2 units.")astracker:self.play(circle.animate.shift(2*LEFT),run_time=tracker.duration)