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.12  # 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.12

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.12
File Size Uploaded Provenance Actions
audiostretchy-1.3.12.tar.gz 1.7 MB Without provenance Details for audiostretchy-1.3.12.tar.gz

Built distributions (wheels)

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

Total release size: 2.0 MB

Release files / audiostretchy-1.3.12.tar.gz

Download URL audiostretchy-1.3.12.tar.gz
Size 1.7 MB
Tags Source
SHA-256 checksum
How to use checksums
050dffb5ee10d8053e85ae8211ef0ad4852c2e553e9562cb452fd442959689bc
BLAKE2b-256 checksum
How to use checksums
931996de5c5a22c512ac5da76c9a6cc6dea667e11775fab874223e3087ceec25
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":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL audiostretchy-1.3.12-py3-none-win_amd64.whl
Size 107.7 kB
Tags Python 3 Windows x86-64
SHA-256 checksum
How to use checksums
a90a8cc66b7859e3779e52270fb771f841c2cb047f71f21586292adc6f889e64
BLAKE2b-256 checksum
How to use checksums
67d13fad25e70e1dbf8523b434ec1c69c63b21202f160cb8a432a143c2dd8db3
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":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL audiostretchy-1.3.12-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
0b9ce81a139f5edf6b8a97d2fcac99462a412ba9b82cdc879c227e0493b73563
BLAKE2b-256 checksum
How to use checksums
0c7b1af965b9aa1883171c8345b899d288682c286ada19a1af67c5d02b4a178b
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":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL audiostretchy-1.3.12-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
edb5a5896aa829a1d71bf46015d97ef08740a15db74abd526cda600373ddfb52
BLAKE2b-256 checksum
How to use checksums
6b840da3f29ead55eb1315a8e5f1bba95d0b3d00a688722a198ae0d0aff69617
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":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL audiostretchy-1.3.12-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
1c8e515a568a5bc32bcc906a3b03043e90d2f6566972fe6e7d784c724ae823ed
BLAKE2b-256 checksum
How to use checksums
a0e68d3d5ec2af3456f9b962b501de86705d8d42265621e5f6dd3140e960e422
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":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

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

Download URL audiostretchy-1.3.12-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
1c35200cf6b7e1878e5f1d53b989db1924f7b914b94f08cf2ac2015368f25292
BLAKE2b-256 checksum
How to use checksums
de700f425c75aa3f95926e47de7e10ed3d99cfde1617c7053b6578fca8f020c9
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":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

Security for audiostretchy 1.3.12

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