Simple way to convert mp3 to ogg then zip? (Python 3)

时间:2015-11-12 11:30:27

标签: python audio mp3 ogg audio-converter

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!

1 个答案:

答案 0 :(得分:0)

  1. 使用lame解码文件。
  2. 使用vorbis tools对其进行编码。
  3. 用zip压缩。
  4. 这里没有任何选项标志:

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

    您可以使用Python或Bash编写脚本。