#!/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 " 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