blob: 201c131ce5883f69a539531b5d3355526f56b22c (
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
39
40
41
|
#!/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=`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
# funker ikke helt enda
./extract_audio $1 0 10
# legg på navn-left/right
./audio_split $NAME
#sox $1 -c 1 $NAME-left.wav mixer -l 2> /dev/null
#sox $1 -c 1 $NAME-right.wav mixer -r 2> /dev/null
./audio_info $NAME-left.$FORMAT &> $NAME-left.$FORMAT.stat
./audio_info $NAME-right.$FORMAT &> $NAME-right.$FORMAT.stat
LEFT=`md5sum $NAME-left.$FORMAT.stat | awk '{print $1}'`
RIGHT=`md5sum $NAME-right.$FORMAT.stat | awk '{print $1}'`
#sox left.wav -n stat &> left.wav.stat
#sox right.wav -n stat &> right.wav.stat
if [ "$LEFT" == "$RIGHT" ]; then
echo 0
else
echo 1
fi
rm $NAME.$FORMAT $NAME-left* $NAME-right*
|