Python library to modify MP3 audio without transcoding

前端 未结 5 948
我寻月下人不归
我寻月下人不归 2021-02-02 14:30

I am looking for some general advice about the mp3 format before I start a small project to make sure I am not on a wild-goose chase.

My understanding of the internals o

5条回答
  •  隐瞒了意图╮
    2021-02-02 15:03

    I got three quality answers, and I thank you all (and upvoted you all) for them. I haven't chosen any as the accepted answer, because each addressed one aspect, so I wanted to write a summary.

    Do you need to work in MP3?

    • Transcoding to PCM and back to MP3 is unlikely to result in a drop in quality.

    • Don't optimise audio-quality prematurely; test it with a simple prototype and listen to it.

    Working in MP3

    • Wikipedia has a summary of the MP3 File Format.

    • MP3 frames are short (1152 samples, or just a few milliseconds) allowing for moderate precision at that level.

    • However, Wikipedia warns that "Frames are not independent items ("byte reservoir") and therefore cannot be extracted on arbitrary frame boundaries."

    • Existing libraries are unlikely to be of assistance, if I really want to avoid decoding.

    Working in PCM

    There are several libraries at this level:

    • LAME (latest release: October 2017)
    • PyMedia (latest release: February 2006)
    • PyMad (Linux only? Decoder only? Latest release: January 2007)

    Working at a higher level

    • Echo Nest Remix API (Mac or Linux only, at the moment) is an API to a web-service that supports quite sophisticated operations (e.g. finding the locations of music beats and tempo, etc.)

    • mp3DirectCut (Windows only) is a GUI that apparently performs the operations I want, but as an app. It is not open-source. (I tried to run it, got an Access Denied installer error, and didn't follow up. A GUI isn't suitably for me, as I want to repeatedly run these operations on a changing library of files.)

    My plan is now to start out in PyMedia, using PCM. Thank you all for your assistance.

提交回复
热议问题