Skip to main content

silk encoding and decoding for python

Project description

✨ rsilk ✨

The python binding for silk-rs

pypi python implementation wheel license action

Usage

  • encode
import rsilk

with open("tests/input.pcm", "rb") as f:
    data = f.read()

output = rsilk.encode(data, 24000, 24000)
with open("output.silk", "wb") as f:
    f.write(output)
  • decode
import rsilk

with open("input.silk", "rb") as f:
    data = f.read()

output = rsilk.decode(data, 24000)
with open("output.pcm", "wb") as f:
    f.write(output)

Exceptions

  • SilkError

Public functions

  • def decode(src: bytes, sample_rate: int, frame_size: int = 0, frames_per_packet: int = 1, more_internal_decoder_frames: bool = False, in_band_fec_offset: int = 0, loss: bool = False) -> bytes

  • def encode(input: bytes, sample_rate: int, bit_rate: int, max_internal_sample_rate: int = 24000, packet_loss_percentage: int = 0, complexity: int = 2, use_inband_fec: bool = False, use_dtx: bool = False, tencent: bool = True) -> bytes

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

rsilk-0.1.4.tar.gz (3.7 kB view hashes)

Uploaded Source

Built Distributions

rsilk-0.1.4-cp312-cp312-win_amd64.whl (184.9 kB view hashes)

Uploaded CPython 3.12 Windows x86-64

rsilk-0.1.4-cp312-cp312-manylinux2014_x86_64.whl (356.4 kB view hashes)

Uploaded CPython 3.12

rsilk-0.1.4-cp312-cp312-macosx_12_0_universal2.whl (305.3 kB view hashes)

Uploaded CPython 3.12 macOS 12.0+ universal2 (ARM64, x86-64)

rsilk-0.1.4-cp311-cp311-win_amd64.whl (186.5 kB view hashes)

Uploaded CPython 3.11 Windows x86-64

rsilk-0.1.4-cp311-cp311-manylinux2014_x86_64.whl (333.8 kB view hashes)

Uploaded CPython 3.11

rsilk-0.1.4-cp311-cp311-macosx_12_0_universal2.whl (305.4 kB view hashes)

Uploaded CPython 3.11 macOS 12.0+ universal2 (ARM64, x86-64)

rsilk-0.1.4-cp311-cp311-macosx_11_0_universal2.whl (295.9 kB view hashes)

Uploaded CPython 3.11 macOS 11.0+ universal2 (ARM64, x86-64)

rsilk-0.1.4-cp310-cp310-win_amd64.whl (187.1 kB view hashes)

Uploaded CPython 3.10 Windows x86-64

rsilk-0.1.4-cp310-cp310-manylinux2014_x86_64.whl (327.2 kB view hashes)

Uploaded CPython 3.10

rsilk-0.1.4-cp310-cp310-macosx_12_0_x86_64.whl (305.4 kB view hashes)

Uploaded CPython 3.10 macOS 12.0+ x86-64

rsilk-0.1.4-cp310-cp310-macosx_11_0_x86_64.whl (294.7 kB view hashes)

Uploaded CPython 3.10 macOS 11.0+ x86-64

rsilk-0.1.4-cp39-cp39-win_amd64.whl (187.1 kB view hashes)

Uploaded CPython 3.9 Windows x86-64

rsilk-0.1.4-cp39-cp39-manylinux2014_x86_64.whl (327.2 kB view hashes)

Uploaded CPython 3.9

rsilk-0.1.4-cp39-cp39-macosx_12_0_x86_64.whl (305.3 kB view hashes)

Uploaded CPython 3.9 macOS 12.0+ x86-64

rsilk-0.1.4-cp39-cp39-macosx_11_0_x86_64.whl (294.7 kB view hashes)

Uploaded CPython 3.9 macOS 11.0+ x86-64

rsilk-0.1.4-cp38-cp38-win_amd64.whl (187.1 kB view hashes)

Uploaded CPython 3.8 Windows x86-64

rsilk-0.1.4-cp38-cp38-manylinux2014_x86_64.whl (327.1 kB view hashes)

Uploaded CPython 3.8

rsilk-0.1.4-cp38-cp38-macosx_12_0_x86_64.whl (305.2 kB view hashes)

Uploaded CPython 3.8 macOS 12.0+ x86-64

rsilk-0.1.4-cp38-cp38-macosx_11_0_x86_64.whl (294.7 kB view hashes)

Uploaded CPython 3.8 macOS 11.0+ x86-64

rsilk-0.1.4-cp37-cp37m-win_amd64.whl (187.1 kB view hashes)

Uploaded CPython 3.7m Windows x86-64

rsilk-0.1.4-cp37-cp37m-manylinux2014_x86_64.whl (327.2 kB view hashes)

Uploaded CPython 3.7m

rsilk-0.1.4-cp37-cp37m-macosx_12_0_x86_64.whl (305.2 kB view hashes)

Uploaded CPython 3.7m macOS 12.0+ x86-64

rsilk-0.1.4-cp37-cp37m-macosx_11_0_x86_64.whl (294.7 kB view hashes)

Uploaded CPython 3.7m macOS 11.0+ x86-64

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page