0

I've got a folder of mp3's I want to convert to .oggs in a specific sample/bit rate e.g. 44.1k, 160 kbps. And then zip them up individually to host online.

I put Python in the title because I enjoy using it but I'm willing to use any free software or apps as well.

Is there a library you would recommend? I found this thread: Python library for converting files to MP3 and setting their quality But it looks fairly outdated

What about for zipping files? I found https://docs.python.org/2/library/zipfile.html which seems like zipfile.zipfile and zipfile.write would cover me.

Thank you!

Community
  • 1
  • 1
veta
  • 716
  • 9
  • 22

1 Answers1

0
  1. Decode the file with lame.
  2. Encode it with the vorbis tools.
  3. Compress it with zip.

Here without any option flags:

lame --decode input.mp3 intermediate.wav
oggenc intermediate.wav -o output.ogg
zip output.zip output.ogg

You can script it with Python or Bash or whatsoever.

Frank Zalkow
  • 3,850
  • 1
  • 22
  • 23
  • Which OS are you using? On Mac Os X things can be easily installed with [homebrew](http://brew.sh/), on Debian based Linux distributions via apt-get. On Windows I am not sure, maybe you really have to compile stuff manually... – Frank Zalkow Nov 13 '15 at 15:45
  • I'm sure there's a trick to it. But from what I saw the readme was talking about compiling and makefiles and I really didn't want to muck with that. lame/oggenc is what most of these programs/libraries are using under the hood so I know you're right that it would work well. – veta Nov 13 '15 at 17:58