lameenc
LAME encoding bindings
What it is and what it does
lameenc is a Python wrapper around the LAME MP3 encoder, providing direct access to LAME's encoding functionality through a simple object-oriented interface. It accepts raw PCM audio data in 16-bit interleaved format and outputs MP3-encoded bytes, with control over bitrate, sample rate, channel count, and encoding quality. The library ships with prebuilt wheels for Linux, macOS, and Windows, eliminating the need to compile LAME yourself.
The package is designed for applications that need to encode audio programmatically—such as real-time transcoding, batch audio processing, or streaming audio services. It requires Python 3.10 or later and has no runtime dependencies beyond the compiled LAME bindings. The encoder is stateful: you configure it once, call encode() repeatedly with audio chunks, then call flush() at the end to finalize the stream.
Use it for:
- Encode raw audio streams to MP3 in real-time applications like voice recording or VoIP systems
- Batch convert PCM audio files to MP3 format with configurable quality and bitrate
- Build audio processing pipelines that need to compress audio before transmission or storage
- Integrate MP3 encoding into media server or transcoding service backends
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Wraps LAME MP3 encoder for Python, providing bindings to encode raw PCM audio data into MP3 format with configurable bitrate, sample rate, channels, and quality settings.
Yes, if you need to encode PCM audio to MP3 in Python and can accept LGPL-3.0-or-later licensing. The package is actively maintained, has no known vulnerabilities, and provides prebuilt wheels for common platforms. The medium install friction is acceptable for a compiled binding. Verify that prebuilt wheels cover your target Python version and architecture before committing.
Install
lameenc on PyPI
pip
pip install lameencuv
uv add lameencpoetry
poetry add lameencInstalling lameenc
Before you install
Medium install friction due to compiled bindings, but prebuilt wheels are available for current Python versions (3.10+) across Linux, macOS, and Windows architectures. Package is actively maintained with recent releases.
License in practice
Licensed under LGPL-3.0-or-later (copyleft). Derivative works and distributions must comply with copyleft obligations; proprietary applications linking this library may require license review.
Quickstart
import lameenc
encoder = lameenc.Encoder()
encoder.set_bit_rate(128)
encoder.set_in_sample_rate(16000)
encoder.set_channels(2)
encoder.set_quality(2)
mp3_data = encoder.encode(interleaved_pcm_data)
mp3_data += encoder.flush()
Requires Python 3.10 or later; input audio must be raw PCM data in 16-bit interleaved format.
Verify before relying
- Whether prebuilt wheels cover all target platforms and Python patch versions you need
- Performance characteristics and memory overhead for large audio streams
- Compatibility with alternative LAME versions or system-installed LAME libraries
Package facts
| License | LGPL-3.0-or-later (copyleft) |
| Python support | supports the current Python release (>=3.10) |
| Install friction | medium — platform-specific wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 48 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 830,558/month — #4,947 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: lameenc-1.8.4-cp310-cp310-macosx_10_9_universal2.whl; lameenc-1.8.4-cp310-cp310-macosx_11_0_arm64.whl; lameenc-1.8.4-cp310-cp310-manylinux1_i686.manylinux_2_34_i686.manylinux_2_5_i686.whl; lameenc-1.8.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; lameenc-1.8.4-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_34_aarch64.whl; lameenc-1.8.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; lameenc-1.8.4-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_34_x86_64.whl; lameenc-1.8.4-cp310-cp310-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl; lameenc-1.8.4-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.manylinux_2_24_x86_64.whl; lameenc-1.8.4-cp310-cp310-manylinux_2_5_i686.manylinux1_i686.manylinux_2_24_i686.whl; lameenc-1.8.4-cp310-cp310-win32.whl; lameenc-1.8.4-cp310-cp310-win_amd64.whl; lameenc-1.8.4-cp311-cp311-macosx_10_9_universal2.whl; lameenc-1.8.4-cp311-cp311-macosx_11_0_arm64.whl; lameenc-1.8.4-cp311-cp311-manylinux1_i686.manylinux_2_34_i686.manylinux_2_5_i686.whl; lameenc-1.8.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; lameenc-1.8.4-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_34_aarch64.whl; lameenc-1.8.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; lameenc-1.8.4-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_34_x86_64.whl; lameenc-1.8.4-cp311-cp311-manylinux_2_17_aarch64.manylinux2014_aarch64.manylinux_2_24_aarch64.whl
Tags
More Conversion packages
Pydub provides a high-level Python interface…
permissive · top 5,000 on PyPI
soxrPerforms high-quality sample-rate conversion…
copyleft · top 5,000 on PyPI
audioreadDecode audio files using whichever backend is…
permissive · top 5,000 on PyPI
cloudinaryCloudinary Python SDK provides image and video…
permissive · top 5,000 on PyPI
miniaudioMiniaudio provides Python bindings for…
permissive · top 15,000 on PyPI
music21music21 is a Python toolkit for analyzing,…
permissive · top 15,000 on PyPI
silk-pythonEncodes and decodes audio in SILK format, a…
permissive · top 15,000 on PyPI
opuslib-nextProvides Python bindings to libopus, the IETF…
permissive · top 15,000 on PyPI
playsoundPlays audio files (MP3, WAV) and URLs from…
permissive · top 15,000 on PyPI
mutagenMutagen reads and writes audio metadata (tags)…
copyleft · top 5,000 on PyPI
audiofileReads and writes audio files across formats…
permissive · top 15,000 on PyPI
tinytagReads metadata (artist, title, duration,…
permissive · top 5,000 on PyPI
descript-audio-codecCompresses audio into discrete codes at 8 kbps…
permissive · top 15,000 on PyPI
audiolabaudiolab loads, processes, and saves audio…
permissive · top 15,000 on PyPI