if [ "$1" = "" -o "$1" = "--help" ]; then echo "Purpose: Read and mix together two audio tracks from same video file." echo "Usage: mix.sh file.mp4" echo "Outcome: 3.wav" echo "Requires: MPlayer, SoX" echo "Aftermath: mplayer -audiofile 3.wav file.mp4" else echo Dumping mplayer -vo null -vc null -benchmark -ao pcm:fast:file=1.wav -aid 0 $1 &>/dev/null & mplayer -vo null -vc null -benchmark -ao pcm:fast:file=2.wav -aid 1 $1 &>/dev/null & wait echo Resampling sox 1.wav 1b.wav rate 44100 vol 1.0 & sox 2.wav 2b.wav rate 44100 vol 0.4 & wait echo Mixing sox -M 1b.wav 2b.wav 3.wav echo Done fi