Created
September 27, 2013 17:34
-
-
Save hellocatfood/6732118 to your computer and use it in GitHub Desktop.
Echobender http://www.hellocatfood.com/echobender/
This file contains 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
#!/bin/sh -e | |
# Echobender | |
# By Antonio Roberts and Martin Meredith | |
# www.hellocatfood.com | www.sourceguru.net | |
# GNU/GPL | |
segons=`(date "+%Y%m%d%H%M%S")` | |
outfile="${segons}" | |
if [ ! -d ./echo ]; then | |
mkdir ./echo | |
fi | |
clear | |
echo -e "\033[31m---------------------------------------------------- \033[0m" | |
echo -e "\033[33m Echobender \033[0m" | |
echo -e "\033[32m---------------------------------------------------- \033[0m" | |
echo -e "\033[35m---------------------------------------------------- \033[0m" | |
read -p "DROP A FILE HERE> " foo | |
echo -e "\033[32mLets bend $foo \033[0m" | |
echo -e "\033[35m---------------------------------------------------- \033[0m" | |
foo="$(echo $foo | sed -e "s/'//" | sed -e "s/'//")" | |
bn=$(basename $foo | sed -e 's/\.[a-zA-Z0-9]*$//') | |
imsize=$(identify -format "%wx%h" $foo) | |
cp $foo ./echo | |
convert ./echo/${bn}.* ./echo/${bn}.bmp | |
cp ./echo/${bn}.bmp ./echo/${bn}.raw | |
sox -r 482170 -e u-law ./echo/${bn}.raw ./echo/${bn}2.raw echo 0.8 0.9 5000 0.3 1800 0.25 | |
convert -size $imsize -depth 8 rgb:./echo/${bn}2.raw ./echo/${bn}.$outfile.bmp | |
rm ./echo/${bn}.raw ./echo/${bn}2.raw ./echo/${bn}.bmp ./echo/${bn}.jpg | |
echo -e "\033[33mJob done. Check ./echo \033[0m" | |
echo -e "\033[31m---------------------------------------------------- \033[0m" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment