Skip to main content

this_file: README.md

AudioStretchy

Change audio duration without changing pitch, using David Bryant's audio-stretch TDHS engine. Pedalboard reads and writes WAV, MP3, FLAC, OGG and AIFF; NumPy handles samples and linear-interpolation resampling.

uv tool install audiostretchy
# 10% shorter, at the same pitch:
audiostretchy input.mp3 output.mp3 --ratio 0.9

For a Python project, use uv add audiostretchy:

from audiostretchy import AudioStretch, stretch_audio

stretch_audio("input.wav", "output.wav", ratio=0.9)

processor = AudioStretch()
processor.open("input.wav")
processor.stretch(ratio=1.2)  # 20% longer
processor.resample(24000)
processor.save("output.wav")

Run audiostretchy --help for all parameters. Ratios from 0.25 to 4.0 are supported; the extended range automatically cascades two TDHS instances. Input must be mono or stereo. Stretching uses 16-bit PCM internally. gap_ratio, buffer_ms, threshold_gap_db, and normal_detection remain compatibility arguments: separate silence stretching is not implemented.

Installation and platforms

Python 3.10 or newer. Published wheels contain one freshly compiled native library and the corresponding C sources and license:

  • Linux x86_64 and aarch64 (manylinux/glibc).
  • macOS Intel and Apple Silicon (macOS 11 or newer).
  • Windows x86_64.

The native library uses ctypes and is independent of the CPython ABI, so wheels carry py3-none-<platform> tags. Dependencies install separately; NumPy and Pedalboard are not copied into the wheel. Other platforms can build from the source distribution when a C compiler and dependency wheels are available. Linux musl and Windows ARM are not part of the tested wheel matrix.

All required TDHS source is bundled under src/audiostretchy/_vendor/audio-stretch. There is no submodule initialization, build-time download, or compiler needed when installing a compatible wheel. UPSTREAM.md records the pinned upstream commit. Builds are reproducible from that snapshot; upstream is not fetched implicitly during releases.

Development

uv sync --frozen
./test.sh                # lint, format check and all tests
uvx hatch test          # alternative Hatch test environment
uv build                # sdist, then a native wheel built from that sdist

Building from source needs a C compiler (cc on Unix or MSVC cl on Windows). On Windows run from a Visual Studio developer shell. The Hatch wheel hook and scripts/compile_c.py share the same compiler implementation. Editable installs compile the library too. CC, CFLAGS, and LDFLAGS are honoured on Unix; MACOSX_DEPLOYMENT_TARGET defaults to 11.0 on macOS.

Releases

hatch-vcs derives package versions from stable vMAJOR.MINOR.PATCH tags. Untagged commits get a development version; source archives preserve their version without needing a Git checkout.

After committing your changes on main:

./publish.sh --check     # tests + local builds + metadata checks; no release
./publish.sh             # auto patch version, push, CI builds, uv publish
./publish.sh minor       # choose a minor or major bump when appropriate
./publish.sh --resume v1.3.14  # resume the same release after fixing an external failure

The release command uses uvx gitnextver to create and atomically push the tag and branch, waits for the Release workflow, downloads its exact artifacts, and checks their metadata. GitHub Actions builds and tests all five platform wheels, checks metadata, publishes with uv publish, and attaches the same files to the GitHub release. Re-running upload is safe for identical files. It never silently creates a new version when resuming a failed release.

Local prerequisites: uv, authenticated gh, and Git push access. GitHub runs uv publish and uses the repository secret PYPI_TOKEN; without it, configure a PyPI trusted publisher for release.yml. Token values must stay out of files and command arguments.

The CI workflow also tests Python 3.10 and 3.14 on Linux, macOS and Windows and builds the same five wheels on pull requests and manual runs.

License

AudioStretchy wrapper: BSD-3-Clause. Bundled TDHS source: David Bryant's BSD-style license in _vendor/audio-stretch/license.txt. Pedalboard is a separate dependency licensed under GPLv3; consult its license when distributing applications that use it.

Metadata

Release files for audiostretchy 1.3.16

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

Source distribution (sdist)

Source distribution for audiostretchy 1.3.16
File Size Uploaded Provenance Actions
audiostretchy-1.3.16.tar.gz 1.8 MB Without provenance Details for audiostretchy-1.3.16.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for audiostretchy 1.3.16
File Actions
audiostretchy-1.3.16-py3-none-win_amd64.whl Python 3 none Windows x86-64 Details for audiostretchy-1.3.16-py3-none-win_amd64.whl
audiostretchy-1.3.16-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64, Linux glibc 2.28+ x86-64 Details for audiostretchy-1.3.16-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
audiostretchy-1.3.16-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64, Linux glibc 2.28+ ARM64 Details for audiostretchy-1.3.16-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
audiostretchy-1.3.16-py3-none-macosx_11_0_x86_64.whl Python 3 none macOS 11.0+ x86-64 Details for audiostretchy-1.3.16-py3-none-macosx_11_0_x86_64.whl
audiostretchy-1.3.16-py3-none-macosx_11_0_arm64.whl Python 3 none macOS 11.0+ ARM64 Details for audiostretchy-1.3.16-py3-none-macosx_11_0_arm64.whl

Total release size: 2.1 MB

Release files / audiostretchy-1.3.16.tar.gz

Download URL audiostretchy-1.3.16.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
6105ea3f8196581a1d36421320e04ce52f69ea28c0dc346e31d8a5aed7dc6c8e
BLAKE2b-256 checksum
How to use checksums
75029daaf3614c2cdf955122abdefadeb306932891fac47d7d9ba5bf230dc4e7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / audiostretchy-1.3.16-py3-none-win_amd64.whl

Download URL audiostretchy-1.3.16-py3-none-win_amd64.whl
Size 108.0 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
c4fed3b0a1432ea51992d8744abb79d1b9d12530ac1a1c612cbd54fa036e8d3b
BLAKE2b-256 checksum
How to use checksums
be34a6552030fd71d02006ac45850fd9766061f9033720ca216d1acd0899b8ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / audiostretchy-1.3.16-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL audiostretchy-1.3.16-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 42.4 kB
Tags Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
3e1f7883f88dd88ca41746d4b77cf06b17f990821f1ecfe5ca4f482b518fc354
BLAKE2b-256 checksum
How to use checksums
7c02d70e7af6ebe7edc39a22294b3b441b78ac0f0f6cb85e06c0bd5a526011ab
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / audiostretchy-1.3.16-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL audiostretchy-1.3.16-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 42.7 kB
Tags Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
5097326c392e547e68a1aacc44b29563139d39c034858ea4bae3520da6001ce4
BLAKE2b-256 checksum
How to use checksums
51fed37b9399b179b4002d2853cb7ddf27340c3f8f2470e8fd824a5bbeaad89e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / audiostretchy-1.3.16-py3-none-macosx_11_0_x86_64.whl

Download URL audiostretchy-1.3.16-py3-none-macosx_11_0_x86_64.whl
Size 39.9 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
21a4cc112b203baab4be3753c883207022bf78f972f7f285f84b0f603d74472e
BLAKE2b-256 checksum
How to use checksums
1bfe79d8dd270645e211744ff27ba16deec53bc5292775cd3ee298b1ca663ada
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / audiostretchy-1.3.16-py3-none-macosx_11_0_arm64.whl

Download URL audiostretchy-1.3.16-py3-none-macosx_11_0_arm64.whl
Size 41.0 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
f5648995525232b0d8b425c9862537c71483377956a02f0c68e882a5f0250c0c
BLAKE2b-256 checksum
How to use checksums
073fac21661542294c0340878eb218618c1d201ebd2acb13c76eccb8becd8344
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.8 {"installer":{"name":"uv","version":"0.13.8","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for audiostretchy 1.3.16

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

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.

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