#!/usr/bin/env bash
# Desc: Copies random audio files
# Usage: bk-copy-rand-music [dir SOURCE] [dir DEST] [int DURATION] ([int BYTES])
-# Version: 0.6.0
+# Version: 0.6.1
# Depends: BK-2020-03: bkshuf v0.1.0
declare -Ag appRollCall # Associative array for storing app status
max_file_size="100000000"; # maximum size per input music file (bytes)
siz_dest="600000000"; # default destination size limit: 600 MB
max_find_depth="10"; # max find depth
-limit_bitrate="320000"; # maximum bitrate (bps) for output audio files
+limit_bitrate="256000"; # maximum bitrate (bps) for output audio files (256000 for opus)
# Load env vars (bkshuf defaults for typical music albums)
if [[ ! -v BKSHUF_PARAM_LINEC ]]; then export BKSHUF_PARAM_LINEC=1000000; fi;
# var limit_bitrate int max output transcode bitrate (bps)
# Output: file
- ffmpeg -nostdin -i "$1" -c:a libopus -b:a "${limit_bitrate}" "${2}.opus";
+ ffmpeg -nostdin -i "$1" -c:a libopus -b:a "${limit_bitrate}" "${2}.opus";
}; # transcode to lower bitrate audio file
main() {