{"id":32175710,"url":"https://github.com/dofuuz/python-soxr","last_synced_at":"2025-10-21T19:46:14.656Z","repository":{"id":47212333,"uuid":"362473728","full_name":"dofuuz/python-soxr","owner":"dofuuz","description":"Fast and high quality sample-rate conversion library for Python","archived":false,"fork":false,"pushed_at":"2025-10-12T13:26:27.000Z","size":188,"stargazers_count":104,"open_issues_count":1,"forks_count":8,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-10-21T19:45:48.002Z","etag":null,"topics":["audio-processing","dsp","libsoxr","python","resampler","samplerate","signal-processing"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dofuuz.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING.LGPL","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2021-04-28T13:16:50.000Z","updated_at":"2025-10-12T13:26:31.000Z","dependencies_parsed_at":"2023-01-31T06:15:10.142Z","dependency_job_id":"2c93f415-4e0f-4cfe-8aca-f64c4cab8d0b","html_url":"https://github.com/dofuuz/python-soxr","commit_stats":{"total_commits":90,"total_committers":2,"mean_commits":45.0,"dds":"0.24444444444444446","last_synced_commit":"5d1cdd4f4c03b69a2629c8650a5830b784c2b636"},"previous_names":[],"tags_count":45,"template":false,"template_full_name":null,"purl":"pkg:github/dofuuz/python-soxr","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofuuz%2Fpython-soxr","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofuuz%2Fpython-soxr/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofuuz%2Fpython-soxr/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofuuz%2Fpython-soxr/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dofuuz","download_url":"https://codeload.github.com/dofuuz/python-soxr/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dofuuz%2Fpython-soxr/sbom","scorecard":{"id":349630,"data":{"date":"2025-08-11","repo":{"name":"github.com/dofuuz/python-soxr","commit":"5cffd023ee9969d28c1f6889499abd53f7f75808"},"scorecard":{"version":"v5.2.1-40-gf6ed084d","commit":"f6ed084d17c9236477efd66e5b258b9d4cc7b389"},"score":3.8,"checks":[{"name":"Code-Review","score":0,"reason":"Found 0/30 approved changesets -- score normalized to 0","details":null,"documentation":{"short":"Determines if the project requires human code review before pull requests (aka merge requests) are merged.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#code-review"}},{"name":"Maintained","score":4,"reason":"4 commit(s) and 1 issue activity found in the last 90 days -- score normalized to 4","details":null,"documentation":{"short":"Determines if the project is \"actively maintained\".","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#maintained"}},{"name":"Binary-Artifacts","score":10,"reason":"no binaries found in the repo","details":null,"documentation":{"short":"Determines if the project has generated executable (binary) artifacts in the source repository.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#binary-artifacts"}},{"name":"Dangerous-Workflow","score":10,"reason":"no dangerous workflow patterns detected","details":null,"documentation":{"short":"Determines if the project's GitHub Action workflows avoid dangerous patterns.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#dangerous-workflow"}},{"name":"Token-Permissions","score":0,"reason":"detected GitHub workflow tokens with excessive permissions","details":["Warn: jobLevel 'contents' permission set to 'write': .github/workflows/build-dist.yml:73","Warn: no topLevel permission defined: .github/workflows/build-dist.yml:1","Warn: no topLevel permission defined: .github/workflows/run-test.yml:1"],"documentation":{"short":"Determines if the project's workflows follow the principle of least privilege.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#token-permissions"}},{"name":"SAST","score":0,"reason":"no SAST tool detected","details":["Warn: no pull requests merged into dev branch"],"documentation":{"short":"Determines if the project uses static code analysis.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#sast"}},{"name":"Pinned-Dependencies","score":0,"reason":"dependency not pinned by hash detected -- score normalized to 0","details":["Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-dist.yml:24: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-dist.yml:30: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-dist.yml:36: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-dist.yml:45: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-dist.yml:56: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/build-dist.yml:77: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-dist.yml:84: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: third-party GitHubAction not pinned by hash: .github/workflows/build-dist.yml:90: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/build-dist.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-test.yml:15: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/run-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-test.yml:20: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/run-test.yml/main?enable=pin","Warn: GitHub-owned GitHubAction not pinned by hash: .github/workflows/run-test.yml:43: update your workflow using https://app.stepsecurity.io/secureworkflow/dofuuz/python-soxr/run-test.yml/main?enable=pin","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:31","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:32","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:48","Warn: pipCommand not pinned by hash: .github/workflows/run-test.yml:49","Info:   0 out of   8 GitHub-owned GitHubAction dependencies pinned","Info:   0 out of   3 third-party GitHubAction dependencies pinned","Info:   0 out of   4 pipCommand dependencies pinned"],"documentation":{"short":"Determines if the project has declared and pinned the dependencies of its build process.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#pinned-dependencies"}},{"name":"CII-Best-Practices","score":0,"reason":"no effort to earn an OpenSSF best practices badge detected","details":null,"documentation":{"short":"Determines if the project has an OpenSSF (formerly CII) Best Practices Badge.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#cii-best-practices"}},{"name":"Vulnerabilities","score":10,"reason":"0 existing vulnerabilities detected","details":null,"documentation":{"short":"Determines if the project has open, known unfixed vulnerabilities.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#vulnerabilities"}},{"name":"Security-Policy","score":0,"reason":"security policy file not detected","details":["Warn: no security policy file detected","Warn: no security file to analyze","Warn: no security file to analyze","Warn: no security file to analyze"],"documentation":{"short":"Determines if the project has published a security policy.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#security-policy"}},{"name":"Fuzzing","score":0,"reason":"project is not fuzzed","details":["Warn: no fuzzer integrations found"],"documentation":{"short":"Determines if the project uses fuzzing.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#fuzzing"}},{"name":"License","score":9,"reason":"license file detected","details":["Info: project has a license file: LICENSE.txt:0","Warn: project license file does not contain an FSF or OSI license."],"documentation":{"short":"Determines if the project has defined a license.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#license"}},{"name":"Branch-Protection","score":0,"reason":"branch protection not enabled on development/release branches","details":["Warn: branch protection not enabled for branch 'main'"],"documentation":{"short":"Determines if the default and release branches are protected with GitHub's branch protection settings.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#branch-protection"}},{"name":"Signed-Releases","score":0,"reason":"Project has not signed or included provenance with any releases.","details":["Warn: release artifact v0.5.0.post1 not signed: https://api.github.com/repos/dofuuz/python-soxr/releases/172873740","Warn: release artifact v0.5.0 not signed: https://api.github.com/repos/dofuuz/python-soxr/releases/171856211","Warn: release artifact v0.5.0rc1 not signed: https://api.github.com/repos/dofuuz/python-soxr/releases/170870386","Warn: release artifact v0.5.0b1 not signed: https://api.github.com/repos/dofuuz/python-soxr/releases/170355673","Warn: release artifact v0.5.0a1 not signed: https://api.github.com/repos/dofuuz/python-soxr/releases/167464008","Warn: release artifact v0.5.0.post1 does not have provenance: https://api.github.com/repos/dofuuz/python-soxr/releases/172873740","Warn: release artifact v0.5.0 does not have provenance: https://api.github.com/repos/dofuuz/python-soxr/releases/171856211","Warn: release artifact v0.5.0rc1 does not have provenance: https://api.github.com/repos/dofuuz/python-soxr/releases/170870386","Warn: release artifact v0.5.0b1 does not have provenance: https://api.github.com/repos/dofuuz/python-soxr/releases/170355673","Warn: release artifact v0.5.0a1 does not have provenance: https://api.github.com/repos/dofuuz/python-soxr/releases/167464008"],"documentation":{"short":"Determines if the project cryptographically signs release artifacts.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#signed-releases"}},{"name":"Packaging","score":10,"reason":"packaging workflow detected","details":["Info: Project packages its releases by way of GitHub Actions.: .github/workflows/build-dist.yml:61"],"documentation":{"short":"Determines if the project is published as a package that others can easily download, install, easily update, and uninstall.","url":"https://github.com/ossf/scorecard/blob/f6ed084d17c9236477efd66e5b258b9d4cc7b389/docs/checks.md#packaging"}}]},"last_synced_at":"2025-08-18T08:01:33.139Z","repository_id":47212333,"created_at":"2025-08-18T08:01:33.139Z","updated_at":"2025-08-18T08:01:33.139Z"},"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":280325297,"owners_count":26311419,"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-10-21T02:00:06.614Z","response_time":58,"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":["audio-processing","dsp","libsoxr","python","resampler","samplerate","signal-processing"],"created_at":"2025-10-21T19:46:11.885Z","updated_at":"2025-10-21T19:46:14.643Z","avatar_url":"https://github.com/dofuuz.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Python-SoXR\n\n[![GitHub](https://img.shields.io/badge/GitHub-python--soxr-181717?logo=github)](https://github.com/dofuuz/python-soxr) [![PyPI](https://img.shields.io/pypi/v/soxr.svg?logo=pypi)](https://pypi.org/project/soxr/) [![conda-forge](https://img.shields.io/conda/vn/conda-forge/soxr-python?logo=conda-forge)](https://anaconda.org/conda-forge/soxr-python) [![Packaging status](https://repology.org/badge/tiny-repos/python:soxr.svg)](https://repology.org/project/python:soxr/versions) [![Read the Docs](https://img.shields.io/readthedocs/python-soxr?logo=read-the-docs)](https://python-soxr.readthedocs.io)\n\nHigh quality, one-dimensional sample-rate conversion library for Python.\n\n- Homepage: https://github.com/dofuuz/python-soxr\n- Documentation: https://python-soxr.readthedocs.io\n- Release Notes: https://github.com/dofuuz/python-soxr/releases\n- PyPI: https://pypi.org/project/soxr/\n\nKeywords: Resampler, Audio resampling, Samplerate conversion, DSP(Digital Signal Processing)\n\nPython-SoXR is a Python wrapper of [libsoxr](https://sourceforge.net/projects/soxr/).\n\n\n## Installation\n\n```sh\npip install soxr\n```\n\nIf installation fails, upgrade pip with `python -m pip install --upgrade pip` and try again.\n\n\n### in Conda environment\n\n```sh\nconda install -c conda-forge soxr-python\n```\n\nNote: Conda packge name is `soxr-python`, not python-soxr.\n\n\n## Basic usage\n\n```python\nimport soxr\n\ny = soxr.resample(\n    x,          # input array – mono(1D) or multi-channel(2D of [frame, channel])\n    48000,      # input samplerate\n    16000       # target samplerate\n)\n```\nIf input is not `numpy.ndarray`, it will be converted to `numpy.ndarray(dtype='float32')`.  \ndtype should be one of float32, float64, int16, int32.\n\nOutput is `numpy.ndarray` with same dimension and data type of input.\n\n\n## Streaming usage\n\nUse `ResampleStream` for real-time processing or very long signal.\n\n```python\nimport soxr\n\nrs = soxr.ResampleStream(\n    44100,              # input samplerate\n    16000,              # target samplerate\n    1,                  # channel(s)\n    dtype='float32'     # data type (default = 'float32')\n)\n\neof = False\nwhile not eof:\n    # Get chunk\n    ...\n\n    y_chunk = rs.resample_chunk(\n        x,              # input aray – mono(1D) or multi-channel(2D of [frame, channel])\n        last=eof        # Set True at end of input\n    )\n```\n\nOutput frame count may not be consistent. This is normal operation.  \n(ex. [0, 0, 0, 186, 186, 166, 186, 186, 168, ...])\n\n📝 [More code examples](https://dofuuz.github.io/dsp/2024/05/26/sample-rate-conversion-in-python.html)\n\n\n## Benchmark\n\nSweep, impulse, speed compairsion with other resamplers for Python.\n\nhttps://colab.research.google.com/drive/1_xYUs00VWYOAXShB85W1MFWaUjGHfO4K?usp=sharing\n\n\n### Speed comparison summary\n\nDownsampling 10 sec of 48000 Hz to 44100 Hz.  \nRan on Google Colab.\n\nLibrary                  | Time on CPU (ms)\n------------------------ | ----------------\nsoxr (HQ)                | 10.8\ntorchaudio               | 13.8\nsoxr (VHQ)               | 14.5\nscipy.signal.resample    | 21.3\nlilfilter                | 24.7\njulius                   | 31\nresampy (kaiser_fast)    | 108\nsamplerate (sinc_medium) | 223\nresampy (kaiser_best)    | 310\nsamplerate (sinc_best)   | 794\n\n\n## Technical detail\n\nFor technical details behind resampler, see libsoxr docs.\n- https://sourceforge.net/p/soxr/wiki/Home/\n- http://sox.sourceforge.net/SoX/Resampling ([archive](https://web.archive.org/web/20230626144127/https://sox.sourceforge.net/SoX/Resampling))\n- https://sourceforge.net/p/soxr/code/ci/master/tree/src/soxr.h\n\nPython-SoXR package comes with [modified version](https://github.com/dofuuz/soxr) of libsoxr. [See changes here](https://github.com/dofuuz/soxr/compare/0.1.3...master).  \nThese changes do not apply to dynamic-linked builds (e.g. conda-forge build).  \nTo check the version of libsoxr, use `soxr.__libsoxr_version__`.\n\n\n## Credit and License\n\nPython-SoXR is LGPL v2.1+ licensed, following libsoxr's license.\n\n### OSS libraries used\n\n#### libsoxr (LGPLv2.1+)\nThe SoX Resampler library  \nhttps://sourceforge.net/projects/soxr/\n\nPython-SoXR is a Python wrapper of libsoxr.\n\n#### PFFFT (BSD-like)\nPFFFT: a pretty fast FFT.  \nhttps://bitbucket.org/jpommier/pffft/  \n\nlibsoxr dependency.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdofuuz%2Fpython-soxr","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdofuuz%2Fpython-soxr","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdofuuz%2Fpython-soxr/lists"}