Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use StitcherService to directly play an mp3 file as a voiceover? #80

Open
arman-sydikov opened this issue Jan 24, 2024 · 1 comment

Comments

@arman-sydikov
Copy link

arman-sydikov commented Jan 24, 2024

As you can see from the screenshot, a demonstration video VoiceoverDemo.mp4 explains at 2:20 that with StitcherService it is possible to directly play an mp3 file as a voiceover.

Screenshot 2024-01-24 at 22 48 57

However when I try to use it a NameError occurs: name 'StitcherService' is not defined

from manim import *
from manim_voiceover import VoiceoverScene

class AzureExample(VoiceoverScene):
    def construct(self):
        # self.set_speech_service(
        #     AzureService(
        #         voice="ru-RU-DmitryNeural",
        #         style="newscast-casual",
        #         global_speed=1.15
        #     )
        # )
        self.set_speech_service(
            StitcherService("test.mp3")
        )

When I tried to fix it by importing StitcherService an ImportError occurred: cannot import name 'StitcherService' from 'manim_voiceover.services.stitcher' (/usr/local/lib/python3.11/site-packages/manim_voiceover/services/stitcher.py)

from manim import *
from manim_voiceover import VoiceoverScene
from manim_voiceover.services.stitcher import StitcherService

class AzureExample(VoiceoverScene):
    def construct(self):
        # self.set_speech_service(
        #     AzureService(
        #         voice="ru-RU-DmitryNeural",
        #         style="newscast-casual",
        #         global_speed=1.15
        #     )
        # )
        self.set_speech_service(
            StitcherService("test.mp3")
        )

So how to directly play an mp3 file as a voiceover?

@mushunrek
Copy link

I have run into the same problem. At the moment, the class has been renamed to _StitcherService, presumably because it is being worked on (?). In particular, I have noticed a bug, see #88. If you want to use _StitcherService anyway, you will have to go into the source code and modify the class as described in #88. This is only a workaround and should probably not be done long term... But at the moment, it works fine for me.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants