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.14

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

Built distributions (wheels)

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

Total release size: 2.0 MB

Release files / audiostretchy-1.3.14.tar.gz

Download URL audiostretchy-1.3.14.tar.gz
Size 1.8 MB
Tags Source
SHA-256 checksum
How to use checksums
a8c52fc4e9e1f6ab1aacd5c3c87aefcaf9d1357549e85b3706130f2f58efcc90
BLAKE2b-256 checksum
How to use checksums
243d10be7754b7fb1360868d283472633e21ef1418c94d08bfaf1c3b6c64a10a
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.14-py3-none-win_amd64.whl

Download URL audiostretchy-1.3.14-py3-none-win_amd64.whl
Size 107.6 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
02b662dce4f8809d33d413ecfcf20215431b57cd0bd4976ca0d63a23478f29c8
BLAKE2b-256 checksum
How to use checksums
aa12c35fc3eb8f16d4b28841f5d8aa270d2b08ca0220f9bef4aa0a758a07f5d9
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.14-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl

Download URL audiostretchy-1.3.14-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.manylinux_2_28_x86_64.whl
Size 42.0 kB
Tags Linux glibc 2.17+ x86-64 Linux glibc 2.28+ x86-64 Python 3
SHA-256 checksum
How to use checksums
6ae67ac9aad2434f60d35356562bb97ae32e700882d076421a224d94231800c6
BLAKE2b-256 checksum
How to use checksums
088c1b4bace92b4f608dbe1be073ec437fdd6a401d385d0a83908d0c893c0b07
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.14-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl

Download URL audiostretchy-1.3.14-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
225323b0ebfaf6aa48d87a46c077b6b523b2863468bba28b65a6fc41056173a8
BLAKE2b-256 checksum
How to use checksums
eefd77a3e68106a33034fc2ffd01022827340d34e2b6a14c5bd85279121632e4
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.14-py3-none-macosx_11_0_x86_64.whl

Download URL audiostretchy-1.3.14-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
d2b1a3fe9ee0af5ddcb33cdddcbb09f156417c98a4e2c93d9e06ce00465a9e56
BLAKE2b-256 checksum
How to use checksums
2dad0f5db88b4fb478b4a2f7b3fc9a31dc2cfe71985bd2b0ef63052c08b7ab61
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.14-py3-none-macosx_11_0_arm64.whl

Download URL audiostretchy-1.3.14-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
5d6ff776905bf65fb9ef71cac89190f771dcf8a31142efb0be4593ff1fd36270
BLAKE2b-256 checksum
How to use checksums
a491b1c14cd2b1836e3899ffa44b0d39b66a70789cda0f2ba1f56066d07b8c02
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.14

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