summaryrefslogtreecommitdiffstats
path: root/tools/audio_split
blob: 48d3065f9e9edd7e148b147244114e309bea1f61 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
#!/bin/bash
#
# Date:    2009-12-10
# Author:  Ole Kristian Lien
# License: GNU General Public License
#
# Splits a audio-file to a left- and right-file.

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

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

# sox FAIL formats: can't open output file `1-left.mp2': SoX was compiled without MP3 encoding support
# kan ikke encode til mp{2,3}...

echo "Splitting up audio to a left- and right-file..."
sox $1 -c 1 $NAME-left.wav mixer -l 2> /dev/null
sox $1 -c 1 $NAME-right.wav mixer -r 2> /dev/null