File: ripdataflac

package info (click to toggle)
flactag 2.0.4-5
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid, stretch
  • size: 2,096 kB
  • ctags: 477
  • sloc: sh: 10,777; cpp: 3,283; makefile: 62; sed: 7
file content (44 lines) | stat: -rwxr-xr-x 935 bytes parent folder | download | duplicates (3)
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
33
34
35
36
37
38
39
40
41
42
43
44
#!/bin/sh

CDROM=/dev/cdrom

if [ "$#" -eq "2" -o "$#" -eq "3" ]
then
	FILENAME=$1
	SPAN=$2

	if [ "$#" -eq "3" ]
	then
		CDROM=$3
	fi

	CDID=`discid $CDROM`
	if cdparanoia $SPAN $FILENAME.bin
	then
		echo "Edit the CUE file to remove the data track"
		sleep 10
		$EDITOR $FILENAME.cue
		if nice flac -8 --replay-gain --endian=big --sign=signed --channels=2 --bps=16 --sample-rate=44100 --cuesheet=$FILENAME.cue $FILENAME.bin
		then
			rm -f $FILENAME.bin
			rm -f ${FILENAME}-fixed.toc
			rm -f $FILENAME.toc
			rm -f $FILENAME.cue*

			FLACID=`flactag --discid $FILENAME.flac | cut -d':' -f 2| cut -d' ' -f 2`

			if [ "$FLACID" != "$CDID" ]
			then
				echo "**********"
				echo "**********"
				echo "**********"
				echo "********** Disc ID of FLAC doesn't match Disc ID of CD **********"
				echo "**********"
				echo "**********"
				echo "**********"
			fi
		fi
	fi
else
	echo "Usage: $0 cdname tracks [ /path/to/cdrom ]"
fi