-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmusicsplit
More file actions
executable file
·33 lines (27 loc) · 1 KB
/
musicsplit
File metadata and controls
executable file
·33 lines (27 loc) · 1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# require:
# shntool,cuetools,eyeD3
#Get the filenames
filetype="$1" # ape or flac
cuefile="$2"
bigfile="$3"
#Other variables
tracks=$(cueprint -d '%N' "$cuefile")
#Output general file information
cueprint -d '%P - %T\n' "$cuefile"
echo "Total number of tracks: " "$tracks"
#Split this bitch directly into MP3 files
#cust='cust ext=mp3 lame -h -V0 -b 320 --vbr-new - %f' # change quality here
namestring="%n-%p-%t" # performer - album - tracknumber - title
shnsplit -i "$filetype" -f "$cuefile" -o "flac" -t "$namestring" "$bigfile"
#ID3 tag MP3 files
i=1
while [ $i -le $tracks ]; do
artist[$i]=$(cueprint -n$i -t '%P' "$cuefile")
album[$i]=$(cueprint -n$i -t '%T' "$cuefile")
tracknum[$i]=$(cueprint -n$i -t '%02n' "$cuefile")
title[$i]=$(cueprint -n$i -t '%t' "$cuefile")
f="${artist[$i]}"-"${album[$i]}"-"${tracknum[$i]}"-"${title[$i]}".mp3
eyeD3 --no-color --set-encoding=utf8 -a "${artist[$i]}" -A "${album[$i]}" -n "${tracknum[$i]}" -t "${title[$i]}" "$f"
i=$[$i+1]
done