vlevel icon indicating copy to clipboard operation
vlevel copied to clipboard

Document a simple way to vlevel-ize an audio file

Open boyska opened this issue 1 year ago • 2 comments

I'd like to apply vlevel to a file of mine. I'm pretty sure this will be simple enough to do, but could you provide some hints?

Use case: I download podcasts from the Internet, then I put them into USB sticks which I'll then plug into my car radio. I'd like to apply vlevel to that!

I'm pretty sure this would be possible (with some sox-magic, maybe?) but having some doc, or even a readymade script will be great! Bonus points if that preserves metadata :)

boyska avatar Jan 13 '24 14:01 boyska

You can utilize any LADSPA-compatible software, such as Audacity or ffmpeg.

  • Example ffmpeg: vlevel-max.sh
#!/bin/bash
set -euo pipefail
if [ "$#" -eq 0 ]; then
    echo "Usage: $0 <input_file1> [<input_file2> ...]"
    exit 1
fi

filters=(
	"ladspa=vlevel-ladspa:vlevel_stereo:0.30|0.78|1|10|0"
)
filter=$(IFS=,; printf "%s" "${filters[*]}")

for path in "$@"; do
	ffmpeg -i "$path" -af "$filter" -vcodec copy  "${path%.*}.out.${path##*.}"
done

Additionally, you can incorporate other filters into your script, like the following:

filters=(
	"ladspa=vlevel-ladspa:vlevel_stereo:0.30|0.78|1|10|0"
	"ladspa=fast_lookahead_limiter_1913:fastLookaheadLimiter:0|-10|0.50"
)

mozlima avatar Jan 15 '24 13:01 mozlima

This works well!

While I agree this is pretty generic, and I could have come up with this on my own with some effort, I think it would be valuable to ship such a script.

boyska avatar Jan 15 '24 16:01 boyska