useful_linux_scripts/m4a_to_mp3.sh

29 lines
753 B
Bash
Raw Permalink Normal View History

2017-06-22 10:26:32 +00:00
#!/bin/bash
# converts ALAC M4A Apple nonsense files to mp3 and converts spaces and tabs
# to underscores in the file names.
# people who put spaces in files names should be put in poorly supplied
# penal colonies along with pedos and terrorists.
SAVEIFS=$IFS
IFS=$(echo -en "\n\b")
for f in *.m4a
do
echo " dollar f is " $f
u=`echo $f | sed 's/[ ]/_/g'`
echo u is $u remove all those stupid spaces in filenames
cp $f $u
t=`echo $u | sed 's/m4a$/mp3/'`
ls -l \'$u\'
echo dollar u: $u becomes dollar t: $t
echo "PROCESSING: " avconv -i \'$f\' -f mp3 $t
#avconv -i $u -qscale:a 0 -f mp3 output.mp3
avconv -i $u -f mp3 output.mp3
echo -------------------------- CONVERTED $f
mv output.mp3 $t
rm -rf $u
done
IFS=$SAVEIFS