Created
June 1, 2012 02:23
-
-
Save Gen2ly/2848140 to your computer and use it in GitHub Desktop.
Define span of multiple folders and join mp3s inside - useful for audio that
This file contains hidden or 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
#!/bin/bash | |
# Define span of multiple folders and join mp3s inside - useful for audio that | |
# spans more than one CD | |
# Display usage if no parameters given | |
if [[ -z "$@" ]]; then | |
echo " ${0##*/} <dir1> <dir2> <filename>.mp3 - folder span mp3 join" | |
exit | |
fi | |
# Create mp3 filelist | |
declare -a filelist | |
for (( i="$1"; i <= "$2"; i++ )) | |
do | |
suffix=$(printf '%03d' "$i") | |
f="Unknown Artist - Unknown Album $suffix" | |
filelist+=("$f"/*.mp3) | |
done | |
# Concatenate mp3s | |
cat "${filelist[@]}" | mp3cat - - > "$3".mp3 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment