summaryrefslogtreecommitdiffstats
path: root/tools/audio_channels_diff
blob: 804687bdabc084cac385733ea11e289435101367 (plain)
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
#!/bin/bash
#
# Date:    2009-12-10
# Author:  Ole Kristian Lien
# License: GNU General Public License
#
# Check if the left and right channel is equal.

# ext-format må fikses!! hmm

EXT=`echo "$1"|awk -F . '{print $NF}'`
NAME=`basename $1 .$EXT`
#FORMAT=`./audio_format $1`

if [ -z "$1" ]; then
	echo "Usage: $0 <video-file>"
	exit 1
fi

if [ ! -f $BASENAME.wav ]; then
	echo "File $BASENAME.wav does not exists"
	./audio_extract $1 0 60
fi

./audio_split $NAME.wav
./audio_stats $NAME-left.wav &> $NAME-left.wav.stat
./audio_stats $NAME-right.wav &> $NAME-right.wav.stat

LEFT=`md5sum $NAME-left.wav.stat | awk '{print $1}'`
RIGHT=`md5sum $NAME-right.wav.stat | awk '{print $1}'`

if [ "$LEFT" == "$RIGHT" ]; then
	echo "eq"
else
	echo "nq"
fi

rm $NAME.wav $NAME-left* $NAME-right*