Sua pergunta é feita sobre a conversão de m4a para mp3.
Este é um script bash que tenho usado por um tempo.
Ajuste o comando avconv
para atender às suas necessidades.
#!/bin/bash
## jc 2016
## convert [m4a mp3 wma] to mp3 128k
## [-vn] disable video recording
##
## avconv with lame mp3 plugin
## [-acodec libmp3lame]
##
## 192 k constant bitrate
## [-ab 192k]
## [-ab 128k]
##
## 44.1kHz sampling rate
## [-ar 44100]
##
## 2 channel audio
## [-ac 2]
##
## force the shell to do a case insensitive comparison
shopt -s nocasematch
working_directory="./mp3_converted"
# check if dir exist
if [ ! -d "$working_directory" ];
then
# dir does not exist
echo "convert directory does not exist $working_directory..."
'mkdir -p "$working_directory"'
echo "convert directory created $working_directory..."
fi
COUNT=0
for i in *; do
case $i in
*.mp3)
avconv -analyzeduration 999999999 -map_metadata 0 -i "$i" -vn -acodec libmp3lame -ac 2 -ab 128k -ar 44100 "$working_directory/'basename "$i" .mp3'.mp3"
echo $i
;;
*.m4a)
##avconv -analyzeduration 999999999 -map_metadata 0 -i "$i" -vn -acodec libmp3lame -ac 2 -ab 128k -ar 44100 "$working_directory/'basename "$i" .m4a'.mp3"
# adjusted for ffmpeg to test.
ffmpeg -i "$i" -n -acodec libmp3lame -ab 128k "$working_directory/'basename "$i" .m4a'.mp3"
echo $i
;;
*.wma)
avconv -analyzeduration 999999999 -map_metadata 0 -i "$i" -vn -acodec libmp3lame -ac 2 -ab 128k -ar 44100 "$working_directory/'basename "$i" .wma'.mp3"
echo $i
;;
*)
echo "other"
;;
esac
done
## back to normal comparison
shopt -u nocasematch
exit 0