skillfed

silk-python

silk encode and decode

silk-python v0.2.8 111.7K downloads/30d#12,401 on PyPI27
Permissive license BSD Active released

What it is and what it does

silk-python is a Python binding for the SILK v3 audio codec, a compression format designed for efficient speech encoding. It provides encode and decode functions that work with file-like objects (including BytesIO for in-memory operations), making it suitable for streaming large audio files without loading them entirely into memory. The package wraps the full C interface of SILK with sensible defaults for parameters like sample rate, bit rate, packet loss handling, and forward error correction.

The implementation uses Cython for performance-critical sections on CPython and falls back to CFFI on PyPy, automatically selecting the appropriate backend. You pass binary streams and specify audio parameters (sample rate, bit rate), and the codec handles the rest. It raises SilkError on encoding or decoding failures, allowing you to handle audio processing errors explicitly.

Use it for:

  • Compress PCM audio files to SILK format for efficient storage or transmission in speech-heavy applications
  • Decode incoming SILK-encoded audio streams in real-time communication or messaging systems
  • Process large audio files in a streaming fashion without loading entire files into memory
  • Integrate SILK codec support into applications that need compatibility with systems using SILK encoding

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Encodes and decodes audio in SILK format, a codec optimized for speech compression, with support for streaming large files through file-like objects.

Yes, if you need SILK codec support. The package is actively maintained, has no known vulnerabilities, supports Python 3.8–3.13, and offers a clean API for both encoding and decoding. Medium install friction is typical for compiled audio libraries. The BSD license poses no restrictions. Install it if your application requires SILK compression or decompression; otherwise, it is not necessary.

Install

silk-python on PyPI

pip

pip install silk-python

uv

uv add silk-python

poetry

poetry add silk-python

Installing silk-python

Before you install

Medium install friction due to compiled wheels; the package is actively maintained with recent commits and provides prebuilt binaries for Python 3.8–3.13 across macOS, Linux, and Windows. Depends only on cffi, a stable low-level FFI library.

License in practice

BSD license is permissive; you may use, modify, and distribute this package freely in commercial or private projects with minimal restrictions.

Quickstart

pip install silk-python

with open("input.pcm", "rb") as pcm, open("output.silk", "wb") as silk:
    encode(pcm, silk, 24000, 24000)

with open("output.silk", "rb") as silk, open("decoded.pcm", "wb") as pcm:
    decode(silk, pcm, 24000)

Verify before relying

  • Whether the package works correctly with PyPy's CFFI backend in production environments
  • Performance characteristics and compression ratios compared to other speech codecs
  • Compatibility with SILK files encoded by other implementations or versions

Package facts

License BSD (permissive)
Python support supports the current Python release (>=3.6)
Install friction medium — platform-specific wheel
Runtime dependencies 1 — cffi
Maintenance actively maintained — 275 days since the last release
Last repo commit
First released
Downloads 111,744/month — #12,401 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: silk_python-0.2.8-cp310-cp310-macosx_10_9_universal2.whl; silk_python-0.2.8-cp310-cp310-macosx_10_9_x86_64.whl; silk_python-0.2.8-cp310-cp310-macosx_11_0_arm64.whl; silk_python-0.2.8-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; silk_python-0.2.8-cp310-cp310-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; silk_python-0.2.8-cp310-cp310-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; silk_python-0.2.8-cp310-cp310-musllinux_1_2_aarch64.whl; silk_python-0.2.8-cp310-cp310-musllinux_1_2_riscv64.whl; silk_python-0.2.8-cp310-cp310-musllinux_1_2_x86_64.whl; silk_python-0.2.8-cp310-cp310-win32.whl; silk_python-0.2.8-cp310-cp310-win_amd64.whl; silk_python-0.2.8-cp310-cp310-win_arm64.whl; silk_python-0.2.8-cp311-cp311-macosx_10_9_universal2.whl; silk_python-0.2.8-cp311-cp311-macosx_10_9_x86_64.whl; silk_python-0.2.8-cp311-cp311-macosx_11_0_arm64.whl; silk_python-0.2.8-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; silk_python-0.2.8-cp311-cp311-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl; silk_python-0.2.8-cp311-cp311-manylinux_2_31_riscv64.manylinux_2_39_riscv64.whl; silk_python-0.2.8-cp311-cp311-musllinux_1_2_aarch64.whl; silk_python-0.2.8-cp311-cp311-musllinux_1_2_riscv64.whl

Keywords: silk, encode, decode, pcm, audio

Development Status :: 4 - BetaLicense :: OSI Approved :: BSD LicenseOperating System :: OS IndependentProgramming Language :: CProgramming Language :: CythonProgramming Language :: PythonProgramming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Multimedia :: Sound/Audio

Tags

silk audio codec encode decodepcm to silk conversionspeech audio compressionsilk format audio processingstreaming audio codecsilk v3 decoder python
audio-codecstreaming

More Sound/Audio packages