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

Normalize Audio #18

Open
ccos89 opened this issue Mar 23, 2024 · 1 comment
Open

Normalize Audio #18

ccos89 opened this issue Mar 23, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@ccos89
Copy link

ccos89 commented Mar 23, 2024

First off - thank you for this addon, it's a total lifesaver for mining from my ereader. My only improvement would be this- in the future would there be any way to normalize the volume of the audio being added to the cards? This could be accomplished through ffmpeg with the loudnorm filter processing the audio before it gets added to the media folder, and could be an optional checkbox. But the audio levels get pretty wacky from Forvo a lot of the time so would be nice to not have people yell in my ear. Currently to remedy this AFAIK one would have to run ffmpeg on the files in the media folder and then reupload media during sync, which is not a short process when you have about ~25k cards...

@DillonWall
Copy link
Owner

Thank you for the feature suggestion. It may take me some time to get around to adding new features, but I will put my thoughts here in case someone else would like to work on it.

It looks like the Python pydub package would work well for this task, but there is a catch. According to the documentation, You can open and save WAV files with pure python. For opening and saving non-wav files – like mp3 – you'll need ffmpeg or libav.

This means that we will need some sort of error handling that checks if the files can be opened with pydub. Otherwise we should warn the user (probably when they check the box to normalize audio) that Only .wav files will be normalized, please install ffmpeg or libav.

I think the best way to implement this would be to add a checkbox for normalizing audio, and either a slider or number box for the desired average dBFS.

An optional feature we could easily add alongside this change would be a combo box for desired audio format. I know many people wish to convert audio files to formats with small sizes, and this way, people would not need to use another addon to convert these files afterwards. Again, this would require a warning when the user attempts to use a non-wav format, but does not have ffmpeg or libav installed.

@DillonWall DillonWall added the enhancement New feature or request label Mar 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants