This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # makes a audiofile to loop itself (seamless by using a crossfade trick) (needs sox audio utilities) | |
| # @dependancy sox | |
| # Usage: ./loopcrossfade <input.wav> <faderatio> [outputdir] | |
| # | |
| loopcrossfade(){ | |
| input="$1"; faderatio="$2"; outputdir="$3"; tmpinput="/tmp/$(basename "$input").loopcrossfade.wav" | |
| [[ ! -f "$input" ]] && echo "cannot find $1" && exit 1 | |
| valid=$(echo "$faderatio > 1.99" | bc -l ); | |
| (( $valid == 0 )) && echo "faderatio should be 2.0 or bigger" && exit 1 |