{"id":16217285,"url":"https://github.com/synodriver/pysilk-cffi","last_synced_at":"2025-09-01T08:09:31.609Z","repository":{"id":62592570,"uuid":"507960727","full_name":"synodriver/pysilk-cffi","owner":"synodriver","description":"silk for pypy","archived":false,"fork":false,"pushed_at":"2022-06-28T08:31:55.000Z","size":1564,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-02T09:44:12.131Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/synodriver.png","metadata":{"files":{"readme":"README.markdown","changelog":"changename.py","contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-06-27T15:19:30.000Z","updated_at":"2022-06-27T15:22:02.000Z","dependencies_parsed_at":"2022-11-03T23:02:15.339Z","dependency_job_id":null,"html_url":"https://github.com/synodriver/pysilk-cffi","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/synodriver/pysilk-cffi","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpysilk-cffi","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpysilk-cffi/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpysilk-cffi/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpysilk-cffi/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/synodriver","download_url":"https://codeload.github.com/synodriver/pysilk-cffi/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/synodriver%2Fpysilk-cffi/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273093463,"owners_count":25044437,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2025-09-01T02:00:09.058Z","response_time":120,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-10T11:26:26.315Z","updated_at":"2025-09-01T08:09:31.587Z","avatar_url":"https://github.com/synodriver.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003ch1 align=\"center\"\u003e\u003ci\u003e✨ pysilk-cffi ✨ \u003c/i\u003e\u003c/h1\u003e\n\n\u003ch3 align=\"center\"\u003eThe cffi binding for \u003ca href=\"https://github.com/kn007/silk-v3-decoder\"\u003esilk-v3-decoder\u003c/a\u003e \u003c/h3\u003e\n\n[![pypi](https://img.shields.io/pypi/v/pysilk-cffi.svg)](https://pypi.org/project/pysilk-cffi/)\n![python](https://img.shields.io/pypi/pyversions/pysilk-cffi)\n![implementation](https://img.shields.io/pypi/implementation/pysilk-cffi)\n![wheel](https://img.shields.io/pypi/wheel/pysilk-cffi)\n![license](https://img.shields.io/github/license/synodriver/pysilk-cffi.svg)\n![action](https://img.shields.io/github/workflow/status/synodriver/pysilk-cffi/build%20wheel)\n\n## 安装\n```bash\npip install pysilk-cffi\n```\n\n\n## 使用\n- encode\n```python\nimport pysilk\n\nwith open(\"verybiginput.pcm\", \"rb\") as pcm, open(\"output.silk\", \"wb\") as silk:\n    pysilk.encode(pcm, silk, 24000, 24000)\n```\n\n- decode\n\n```python\nimport pysilk\n\nwith open(\"verybiginput.silk\", \"rb\") as silk, open(\"output.pcm\", \"wb\") as pcm:\n    pysilk.decode(silk, pcm, 24000)\n```\n\n## 支持功能\n- 接受任何二进制的```file-like object```，比如```BytesIO```，可以流式解码大文件\n- 包装了silk的全部C接口的参数，当然他们都有合理的默认值\n\n## 公开函数\n```python\nfrom typing import BinaryIO\n\ndef encode(input: BinaryIO, output: BinaryIO, 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) -\u003e bytes: ...\ndef decode(input: BinaryIO, output: BinaryIO, 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) -\u003e bytes: ...\n```\n\n## 公开异常\n```python\nclass SilkError(Exception):\n    pass\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Fpysilk-cffi","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsynodriver%2Fpysilk-cffi","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsynodriver%2Fpysilk-cffi/lists"}