aboutsummaryrefslogtreecommitdiff
path: root/.local/share/bin/folder2cd
blob: 558c6abe50f13dd8e9e2d160e9591c2af3c2406b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#!/bin/sh

FILEEXT="flac"
set -e

convert() {
	wav="${1%.flac}-cd.wav"
	echo "ffmpeg -loglevel warning -y -i \"$1\" -sample_fmt s16 -ar 44100 \"$wav\""
	ffmpeg -loglevel warning -y -i "$1" -sample_fmt s16 -ar 44100 "$wav"
}

export -f convert
parallel -j4 convert ::: *.$FILEEXT

FILES=`find . -name '*-cd.wav' -printf '%f\n' | sort -n`
echo "$FILES" | xargs -d"\n" -t wodim -sao -audio -pad speed=20

echo "wodim -eject"
wodim -eject

echo "rm -f *-cd.wav"
rm -f *-cd.wav