Python wrappers for libvorbis

This article provides an overview of the Python wrappers and libraries available for integrating the libvorbis reference audio codec into Python applications. It details the most popular direct bindings, high-level audio libraries that wrap Vorbis functionality, and metadata tools specifically designed for handling Ogg Vorbis files.

PyOgg

PyOgg is a wrapper for libogg, libvorbis, libopus, and libflac using Python’s built-in ctypes library. It allows Python developers to read and write Ogg Vorbis files directly by interfacing with the underlying C libraries.

SoundFile (PySoundFile)

soundfile is an audio library based on libsndfile, a widely used C library for reading and writing audio files. Since libsndfile supports the Ogg Vorbis format via libvorbis, soundfile serves as an excellent, high-level Python wrapper.

Pydub

Pydub is a high-level audio manipulation library that simplifies audio processing in Python. While it does not bind directly to libvorbis via C headers, it utilizes FFmpeg or Avconv behind the scenes to handle audio encoding and decoding.

Mutagen (For Metadata Only)

If your Python application only needs to read or write metadata (such as artist, title, or track number) without decoding or encoding the actual audio data, Mutagen is the standard library for the task.