Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/synodriver/rsilk
silk encoder and decoder for python
https://github.com/synodriver/rsilk
pyo3 python rust silk
Last synced: 18 days ago
JSON representation
silk encoder and decoder for python
- Host: GitHub
- URL: https://github.com/synodriver/rsilk
- Owner: synodriver
- License: mit
- Created: 2022-03-12T08:43:19.000Z (over 2 years ago)
- Default Branch: stream
- Last Pushed: 2023-10-13T15:09:58.000Z (about 1 year ago)
- Last Synced: 2024-10-11T11:26:08.869Z (about 1 month ago)
- Topics: pyo3, python, rust, silk
- Language: Python
- Homepage:
- Size: 15.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.markdown
- Changelog: changename.py
- License: LICENSE
Awesome Lists containing this project
README
✨ rsilk ✨
The python binding for silk-rs
[![pypi](https://img.shields.io/pypi/v/rsilk.svg)](https://pypi.org/project/rsilk/)
![python](https://img.shields.io/pypi/pyversions/rsilk)
![implementation](https://img.shields.io/pypi/implementation/rsilk)
![wheel](https://img.shields.io/pypi/wheel/rsilk)
![license](https://img.shields.io/github/license/synodriver/rsilk.svg)
![action](https://img.shields.io/github/workflow/status/synodriver/rsilk/build%20wheel)## Usage
- encode
```python
import rsilkwith 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
```python
import rsilkwith 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