Convert ogg files to mp3 using sox

From Paldo

Jump to: navigation, search

Trick by Philip Miller

First you have to install sox. Mostly it is already installed.
Check this by typing:

  upkg-show sox

If not install it with

  sudo upkg-install --verbose sox

Change into the folder where your ogg-files are and enter these two lines into the terminal:

  for x in * ; do mv "$x" `echo -n $x | tr " " "_"`; done
  for x in *.ogg ; do sox $x `echo $x|awk -F . '{print $1 ".mp3"}'`; done

The first line replaces the spaces with "_"-signs, the second converts the files using sox.
After that you should have all files also in mp3.

Personal tools