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.13  # 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 runs uv publish. 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, Git push access, and PyPI upload credentials if local upload is needed (UV_PUBLISH_TOKEN). GitHub 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.13

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.13
File Size Uploaded Provenance Actions
audiostretchy-1.3.13.tar.gz 1.8 MB Without provenance Details for audiostretchy-1.3.13.tar.gz

Built distributions (wheels)

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

Total release size: 2.0 MB

Release files / audiostretchy-1.3.13.tar.gz

Download URL audiostretchy-1.3.13.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
414f279062177d0a6569e73c35c470dfb83ada624aa9306b7c3a9d215f4fb886
BLAKE2b-256 checksum
How to use checksums
dce982084b69f898cd4f1ad50b1681748fa6cd93918d768c58334b5914d6819e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.13-py3-none-win_amd64.whl

Download URL audiostretchy-1.3.13-py3-none-win_amd64.whl
Size 107.6 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
959e65d85f4e2ddf380513b394a051ac97c84321726402aa7015076aa30b72a5
BLAKE2b-256 checksum
How to use checksums
ce06066a62d4c5f29f8ffb5ec2a3b52c40db4b5b957262e77aedf5aad743343b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.13-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL audiostretchy-1.3.13-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 42.1 kB
Tags Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
dee84676a844bacec84a248c18792425fe5648ffaad6cde355f5d732b12b4a82
BLAKE2b-256 checksum
How to use checksums
1d2cc940e79539691ca01293bfc2e148b52ca9d6ca91f43edf4c8c688fce83b1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.13-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL audiostretchy-1.3.13-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl
Size 42.3 kB
Tags Linux glibc 2.17+ ARM64 Linux glibc 2.28+ ARM64 Python 3
SHA-256 checksum
How to use checksums
6b21616a21cd70559248b0a8ffe489c4289e700c63625ae33106922b6499eb93
BLAKE2b-256 checksum
How to use checksums
28104610f39e6697fdaed751cca7621c4ce3f2aacff4e06ab490420234bfec5b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.13-py3-none-macosx_11_0_x86_64.whl

Download URL audiostretchy-1.3.13-py3-none-macosx_11_0_x86_64.whl
Size 39.5 kB
Tags Python 3 macOS 11.0+ x86-64
SHA-256 checksum
How to use checksums
759c1fda1e1bc6854ae04be9a11f7775430b35b85561583b04d9f4709a61c81d
BLAKE2b-256 checksum
How to use checksums
40f9d6c34379ff575dcc56885c42a780e245f871845dd5d346570ed10f5945a5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.13-py3-none-macosx_11_0_arm64.whl

Download URL audiostretchy-1.3.13-py3-none-macosx_11_0_arm64.whl
Size 40.6 kB
Tags Python 3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
b7fb8bb86193af50b9a73603bc8c822d15a549bb366f78822b60bf4f1a4d2a7c
BLAKE2b-256 checksum
How to use checksums
6687e9c2e82b960a4725dbbc9ade6efa8cab9ff7622a3b6624688c476cffa250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.13.7 {"installer":{"name":"uv","version":"0.13.7","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","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.13

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