.m4a to .mp3
# Convert .m4a files in a given directory to .mp3, removing the .m4a files as
# we go.
function m4a2mp3 {(
cd "${1:-.}" &&
for f in *.m4a
do ffmpeg -i "$f" -ab 320k -acodec libmp3lame "${f%.m4a}.mp3" && rm "$f"
done
)}
# Another way, using find to discover all .m4a files, at any depth.
function m4a2mp3 {(
cd "${1:-.}" &&
find . -type f -name '*.m4a' -print0 | while read -r -d '' f
do ffmpeg -i "$f" -ab 320k -acodec libmp3lame "${f%.m4a}.mp3" && rm "$f"
done
)}
Written by Jason Dusek
Related protips
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Find
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#