blob: e615a5093771627e0b826b28013ba6fd70be85c9 (
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
|
#!/bin/bash
#
# Date: 2009-12-10
# Author: Ole Kristian Lien
# License: GNU General Public License
#
# Splits stereo channel into left and right, then
# combines them back into an audio file (stereo)
BITRATE=`./audio_bitrate $1`
EXT=`echo "$1"|awk -F . '{print $NF}'`
NAME=`basename $1 .$EXT`
if [ -z "$1" ]; then
echo "Usage: $0 <audio-file>"
exit 1
fi
#sox $1 -c 1 left.wav mixer -l 2> /dev/null
#sox $1 -c 1 right.wav mixer -r 2> /dev/null
./audio_split $1
sox -m $NAME-left.wav $NAME-right.wav mono.wav 2> /dev/null
sox mono.wav -c 2 stereo.wav 2> /dev/null
ffmpeg -i stereo.wav -acodec $EXT -ab "$BITRATE"k $NAME-new.$EXT 2> /dev/null
rm $NAME-left.wav $NAME-right.wav mono.wav stereo.wav
|