Skip to content

Instantly share code, notes, and snippets.

@danpaluska
Created February 18, 2011 19:22
Show Gist options
  • Save danpaluska/834248 to your computer and use it in GitHub Desktop.
Save danpaluska/834248 to your computer and use it in GitHub Desktop.
combine a bunch of audio snippets into a single file, uses sox and crossfade_cat.sh
#! /bin/bash
# rename and then recombine the audio stuff
date=$1
counter=10000
deslength=1
for f in audio*.wav; do
let "counter+=1"
let "deslength+=1"
mv $f audio${counter:1}.wav
done
# is this is done right i might not have to calculate anything but for now i think i do??
# capture should work by capturing one 2 second clip of audio for every 10 frames of video...
#desiredlength=122
echo deslength=$deslength
numbersnips=$counter
#$crossfade_duration=1.25
mv audio0001.wav mix2.wav
# mix all the snips...
for f in audio*.wav; do
echo "snip $f"
sleep 2
# add snip*.mov to file mix2.wav
~/crossfade_cat.sh 1.00 mix2.wav $f yes yes
# output of crossfade.cat is mix.wav
mv mix.wav mix2.wav
done
sox mix2.wav soundtrack.mp3
new_length=`sox --info -D mix2.wav | cut -d"." -f1`
echo "new length = $new_length"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment