by mguhlin

Convert m4a to ogg

EdTech

How to convert multiple m4a audio files in one directory to ogg format in UbuntuLinux? That’s the question that got me started down this road.

I was hoping for an easy way to do multiple files using FFMPEG but I don’t understand the command line structure well enough. In the meantime, I ran across this script that does the job.

  1. Install faad and lame with the command - sudo apt-get install faad lame

  2. Copy-n-paste the script and save it as m4a2mp3.sh in your /home/usrdirectory
    (e.g. /home/mg)

  3. Make the script executable with this command - sudo chmod 777 m4a2mp3.sh

  4. Switch to the directory and call the script with /home/m4a2mp3.sh

(Note: If you find an error in these instructions, please let me know! Thx in advance!)

#!/bin/bash#for i in *.wma ; docurrent_directory=$( pwd )#remove spacesfor i in *.[Mm]4[Aa]; do mv "$i" `echo $i | tr ' ' '_'`; done#remove uppercasefor i in *.[Mm]4[Aa]; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done#ripping with mplayerecho Processing file: $i#for i in *.mp3 ; do mplayer -vo null -vc dummy -ao pcm:file=$i.wav $i; donefor i in *.m4a ; do faad $i; done#Convert to OGGoggenc *.wav;#removing old filerm *.wav;#rm *.m4a

How would one do this for multiple files with FFMPEG?


var addthis_pub=“mguhlin”;


Subscribe to Around the Corner-MGuhlin.org


Be sure to visit the ShareMore! Wiki.