Skip to main content

Bungee Python Bindings

当前版本 Version: 0.2.0

🆕 0.2.0 更新日志 / Changelog:

  • 修复了上一版本的初始延迟导致的结果偏移的问题。
  • Fixed the initial latency/offset issue in previous versions.
  • 建议所有用户升级到 0.2.0 版本。

PyPI version License: MPL 2.0

该项目提供了 Bungee C++ 库的 Python 绑定,允许您在 Python 中轻松实现高质量的实时音频时间拉伸和变调。

This project provides Python bindings for the Bungee C++ library, enabling high-quality real-time audio time-stretching and pitch-shifting in Python.


特性 Features

  • 高质量的音频时间拉伸和变调
    High-quality audio time-stretching and pitch-shifting
  • 支持实时处理,低延迟
    Real-time processing with low latency
  • 允许连续改变播放速度和音高,支持平滑搓碟和变速播放
    Continuous speed/pitch change, smooth scratching, and variable playback
  • 基于频域相位声码器算法
    Frequency-domain phase vocoder algorithm
  • 使用现代 C++ 编写,代码清晰健壮
    Modern C++ implementation, robust and clean code
  • 采用 MPL-2.0 宽松许可证
    Licensed under MPL-2.0

安装 Installation

您可以通过 pip 从 PyPI 安装 bungee-python:

You can install bungee-python from PyPI via pip:

pip install bungee-python

使用示例 Example

下面是一个简单的示例,演示如何使用 bungee-python 将音频速度减慢一半:

Here is a simple example showing how to slow down audio by half using bungee-python:

import numpy as np
from bungee_python import bungee

sample_rate = 44100
channels = 1
duration_seconds = 5
frequency = 440

t = np.linspace(0., duration_seconds, int(sample_rate * duration_seconds))
input_audio = 0.5 * np.sin(2. * np.pi * frequency * t)
input_audio = input_audio.astype(np.float32)
input_audio = input_audio[:, np.newaxis]  # (frames, channels)

stretcher = bungee.Bungee(sample_rate=sample_rate, channels=channels)
stretcher.set_speed(0.5)  # 慢放 slow down
stretcher.set_pitch(1.0)  # 音高不变 keep pitch

output_audio = stretcher.process(input_audio)
print(f"Output shape: {output_audio.shape}")

从源码构建 Build from Source

  1. 克隆仓库 (包括子模块) / Clone repository (with submodules):

    git clone --recurse-submodules https://github.com/longredzhong/bungee-python.git
    cd bungee-python
    
  2. 安装构建依赖 / Install build dependencies:

    • C++ 编译器 (支持 C++17) / C++17 compiler
    • CMake (>= 3.15)
    • Ninja (推荐 recommended)
    • Python (>= 3.8) 和开发头文件 / Python dev headers
  3. 运行构建脚本 / Run build script:

    ./scripts/build.sh
    

    编译后的 Python 扩展模块会位于 build 目录中。
    The built Python extension module will be in the build directory.

  4. 安装或测试 / Install or test:

    可以用 pip install . 在本地安装。
    You can install locally with pip install ..


依赖 Dependencies

  • 运行时 Runtime:
    • Python (>= 3.8)
    • NumPy
  • 构建时 Build:
    • bungee-core (as submodule)
      • Eigen
      • KissFFT
    • pybind11 (as submodule)
    • CMake (>= 3.15)
    • C++17 compiler
    • Ninja (optional)

许可证 License

本项目采用 MPL-2.0 许可证,与 bungee-core 保持一致。
This project is licensed under MPL-2.0, same as bungee-core.


致谢 Acknowledgements


Metadata

Release files for bungee-python 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for bungee-python 0.2.1
File Size Uploaded Provenance Actions
bungee_python-0.2.1.tar.gz 4.1 MB With provenance Details for bungee_python-0.2.1.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for bungee-python 0.2.1
File Actions
bungee_python-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-64 Details for bungee_python-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
bungee_python-0.2.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.13 CPython 3.13 Linux glibc 2.17+ x86-32 Details for bungee_python-0.2.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
bungee_python-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-64 Details for bungee_python-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
bungee_python-0.2.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.12 CPython 3.12 Linux glibc 2.17+ x86-32 Details for bungee_python-0.2.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
bungee_python-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-64 Details for bungee_python-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
bungee_python-0.2.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.11 CPython 3.11 Linux glibc 2.17+ x86-32 Details for bungee_python-0.2.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
bungee_python-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-64 Details for bungee_python-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
bungee_python-0.2.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.10 CPython 3.10 Linux glibc 2.17+ x86-32 Details for bungee_python-0.2.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
bungee_python-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-64 Details for bungee_python-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
bungee_python-0.2.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl CPython 3.9 CPython 3.9 Linux glibc 2.17+ x86-32 Details for bungee_python-0.2.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl

Total release size: 7.9 MB

Release files / bungee_python-0.2.1.tar.gz

Download URL bungee_python-0.2.1.tar.gz
Size 4.1 MB
Tags Source
SHA-256 checksum
How to use checksums
b3521438e08c2b7e979d95f3e76cee27a4691fb4bf2a2bb2d7855d7cd2f212d1
BLAKE2b-256 checksum
How to use checksums
1b9b371ca111873f624596d5f6a6672bd84cb43603558ce775d353aaecb73e71
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bungee_python-0.2.1-cp313-cp313-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 368.9 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
ce90d767886d0a3d0ccd571f16e356363666f51ffe8082c18f03eec7a2f0d289
BLAKE2b-256 checksum
How to use checksums
5243735a6647bd1bca3b4c40c1b080e692fae80d04274adea01c342d73462786
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL bungee_python-0.2.1-cp313-cp313-manylinux_2_17_i686.manylinux2014_i686.whl
Size 394.2 kB
Tags CPython 3.13 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
a02e18e33d028045a84b0559bd42f434432a2887eca1dab51dd6318afbe7f9dc
BLAKE2b-256 checksum
How to use checksums
323d73d5f571406324c517bda8181ab1f0579302b082b5b6fcc872228d5e325a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bungee_python-0.2.1-cp312-cp312-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 367.8 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
45a14db4537e1f4e5f03a6078f0aa4a2eb911138e6ea265b37b24b7f8cc4a4a7
BLAKE2b-256 checksum
How to use checksums
aa60027b03cb4782308481d74605e3af239f3daf03323467d9b169cb4dd55be6
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL bungee_python-0.2.1-cp312-cp312-manylinux_2_17_i686.manylinux2014_i686.whl
Size 393.2 kB
Tags CPython 3.12 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
5d50ec7c54aa56a5ed5c93d591e01a21c727c25f4e32971f50c1132b74df0e97
BLAKE2b-256 checksum
How to use checksums
f9d162fca2a742efa382e161bb8d34aa7d06299cd2c624c647123b48fdea9ec0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bungee_python-0.2.1-cp311-cp311-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 368.2 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
92e0d75210a9af16a95d6ae5b3aa33a1c1fdc21008e2ddb960967663ca5ec24c
BLAKE2b-256 checksum
How to use checksums
bf18d30ea627fdcfdcd57328967ccff50e41a7290607663d15c203626d3162f4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL bungee_python-0.2.1-cp311-cp311-manylinux_2_17_i686.manylinux2014_i686.whl
Size 393.5 kB
Tags CPython 3.11 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
6a7b0781505ae7b445cd395c74cca5ff016a62a5a05f762d74b3ac07e8d7291d
BLAKE2b-256 checksum
How to use checksums
c8666fa3dcb6b2e19e36c237b11d4c88567f9c229ef1c2655ece9ff71b60689f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bungee_python-0.2.1-cp310-cp310-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 367.3 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
205ac5e6b5d25eec71aa940fb801021f209e8613e4bcb884840eedb1e6a01b5e
BLAKE2b-256 checksum
How to use checksums
3d75d102d1a1777c4971022a9a96f32412aeb7f5ec132912470b3fae58bc25d0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL bungee_python-0.2.1-cp310-cp310-manylinux_2_17_i686.manylinux2014_i686.whl
Size 392.8 kB
Tags CPython 3.10 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
e63a6c1cf98820d58c6fb5a61ef5335488d5f9a9232bd1533317c209b5662104
BLAKE2b-256 checksum
How to use checksums
713de3cdb4bb3bd64941280264cab5cb83d06cf527895ac884485b591120fc38
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl

Download URL bungee_python-0.2.1-cp39-cp39-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Size 367.5 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-64
SHA-256 checksum
How to use checksums
757adb504bd08e7f2a68f71833156b772e0dff91f9e5371d0aa1c4f15d57644b
BLAKE2b-256 checksum
How to use checksums
4b24bf946736fe2c4e040afa1f67d2f757d37b683715b412fc0e2597dcb23684
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Release files / bungee_python-0.2.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl

Download URL bungee_python-0.2.1-cp39-cp39-manylinux_2_17_i686.manylinux2014_i686.whl
Size 393.0 kB
Tags CPython 3.9 Linux glibc 2.17+ x86-32
SHA-256 checksum
How to use checksums
c9673af819c6940707278cdbff0cc1aa5ab59794d65b1991c7cc2477747765dd
BLAKE2b-256 checksum
How to use checksums
7c0920d6763dbe2b0b57476634469b15f08bb1261914e3ae3bfe9220e6fcfe95
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.12.9

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

Security for bungee-python 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 11 files in this release have been uploaded with provenance metadata.

Select from 11 files

Attestation for bungee_python-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 13, 2025.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.2.1 This release

11 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page