Add automatic audio normalisation to highest volume #14
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
The karaoke library has a massive variation in the volumes of different songs, which is not only annoying when the speaker volume has to be constantly readjusted, but it also makes the quietest songs difficult to hear and sing. Therefore, this PR introduces automatic volume normalisation using the
ffmpeg-normalize
tool. However, this is only used when the kara.moe map consists of video instead of audio since in that case the audio is already being re-encoded and therefore adding volume normalisation at the same time should not introduce any additional compression artifacts. The normalisation does not take place in the case when the kara.moe map contains audio and not video to avoid compression artifacts, but we can discuss this.The normalisation is set to be to the highest reasonable volume (i.e. highest volume that does not degrade audio quality) to avoid having too quiet songs; from my experience it is always easier to turn volume down than up during karaoke.
To test
ffmpeg -i a.mp3 -af "volumedetect" -vn -sn -dn -f null -
command and see that the max volume is close to 0.