Last active
March 14, 2022 20:10
-
-
Save aynik/841e267f5be8d90e3ab2405dc8b950e0 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
set -eu | |
SKIP_TRACKS=$((${SKIP_TRACKS:=0} + 1)) | |
while ALBUM="$1" && [ ! -z "$ALBUM" ]; do | |
find "$ALBUM" -iname "*.flac" \ | |
| sed -e 's:\(.*/\)\([^/]*\):\2 \1\2:' \ | |
| sort -n \ | |
| sed -e 's:[^/]* ::' \ | |
| tail -n +$SKIP_TRACKS \ | |
| tr '\n' '\0' \ | |
| xargs -0 -n 1 bash -c '\ | |
echo "$0" > "$HOME/.recording" \ | |
&& (sox -v 0 "$0" -t sox - synth sine mix 1 gain -36 \ | |
| sox --replay-gain off -m "$0" -t sox - -t coreaudio "NFJ USB Audio" norm -1 ) \ | |
&& sleep 2' | |
shift | |
done | |
rm $HOME/.recording |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment