Skip to content

Instantly share code, notes, and snippets.

@hellocatfood
Created September 27, 2013 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save hellocatfood/6732118 to your computer and use it in GitHub Desktop.
Save hellocatfood/6732118 to your computer and use it in GitHub Desktop.
#!/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