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

Feature request: Add built-in mp3 conversion #3

Open
barseghyanartur opened this issue Jan 7, 2023 · 2 comments
Open

Feature request: Add built-in mp3 conversion #3

barseghyanartur opened this issue Jan 7, 2023 · 2 comments

Comments

@barseghyanartur
Copy link

ffmpeg-python would be a dependency:

pip install ffmpeg-python

Sample code:

import ffmpeg

ffmpeg.input(filename).output(filename + '.mp3').run()
@Poeschl
Copy link
Owner

Poeschl commented Jan 9, 2023

This will also require ffmpeg to be installed on the system. Something I find a little much for a TTS package.
I use this package in an environment where this can not guaranteed. So I suggest to convert it after the retrieval to keep this package as modular as possible

@barseghyanartur
Copy link
Author

barseghyanartur commented Jan 9, 2023

That would make the package more usable. If you don't consider this a core functionality, you could make it optional. It's not like I can't do that myself. It's about ease of use.

I would much prefer to replace most of that code with something like:

# Return MP3 file as bytes
return mary_tts.synth_raw_mp3(self.content)

or at least to something like this:

# Write MP3 file
with open(filename, "wb") as file:
    file.write(mary_tts.synth_mp3(self.content))

Adding a couple of additional helper methods would certainly not hurt the package. And as I said, making things optional but available makes more developers happy.

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