This commit adds handling of KeyboardInterrupts. For this purpose, a
signal handler is installed for all processes and a global variable
that calls further cleanup steps. Because processes are used, each
process receives the SIGINT. To properly stop and not just wait for
something to handle the SIGINT, each process raises a custom
`CleanupRequired` error and exits.
Based on
https://ffmpeg.org/pipermail/ffmpeg-user/2024-March/057775.html
loudnorm is a low quality filter.
Some research gave some alternatives.
One of these is "pyloudnorm", a native python module implementing
EBU R 128 loudness normalization.
This is what I have implemented now instead of the old ffmpeg
filter.
In the future additional rewrites to use the official FLAC and OPUS
encoders might be desirable for better compression.
- Implement different conversions for lossless and lossy sources
- Remove unused functions
- Cleanup comments
I noticed that FLAC --> FLAC normalisation will change the bit depth
from 16 to 24. Wasn't able to find a simple solution for it, so I
asked on the ffmpeg-user mailing list
https://ffmpeg.org/pipermail/ffmpeg-user/2024-March/057774.html