Skip to main content

Audio processing plugin for TWAT

Project description

twat-audio

twat-audio is the audio-file domain package for the twat ecosystem. It preserves the existing Pedalboard resampling API and adds deterministic ffmpeg-backed helpers for common audio-file workflows.

Requirements

  • Python 3.10+
  • pedalboard for resampling
  • ffmpeg/ffprobe for metadata, trimming, extraction, normalization, and muxing helpers

Python API

from twat_audio import AudioProcessConfig, resample_audio, normalize_audio, trim_audio

resample_audio(AudioProcessConfig("input.wav", "speech-16k.wav", target_samplerate=16000.0))
normalize_audio("input.wav", "normal.wav")
trim_audio("input.wav", "intro.wav", start=0, duration=5)

Implemented helpers:

  • resample_audio: existing Pedalboard resampling behavior.
  • audio_metadata: ffprobe metadata.
  • normalize_audio, trim_audio, extract_audio.
  • replace_audio: import/replace media audio tracks.
  • simple_effect: explicit ffmpeg audio filter helper for deterministic effects.
  • generate_audio: optional thin adapter to twat_genai audio providers.

Speech-specific STT, TTS, and dubbing orchestration belong in twat_speech; this package stays focused on audio files and signals.

CLI

python -m twat_audio --help
python -m twat_audio resample input.wav speech.wav --samplerate 16000
python -m twat_audio normalize input.wav normal.wav --dry-run
python -m twat_audio trim input.wav clip.wav --start 2 --duration 5 --dry-run
python -m twat_audio extract movie.mp4 voice.wav --dry-run
python -m twat_audio replace silent.mp4 voice.wav dubbed.mp4 --dry-run

Reference scripts

The audio portions of vidimportaudio, vidpredub.py, viddub-*, and vidreverb.py are represented here only where they are deterministic audio-file operations. Dubbing plans, speech provider calls, transcript handling, and subtitle work live in twat_speech.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

twat_audio-2.7.7.tar.gz (18.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

twat_audio-2.7.7-py3-none-any.whl (10.5 kB view details)

Uploaded Python 3

File details

Details for the file twat_audio-2.7.7.tar.gz.

File metadata

  • Download URL: twat_audio-2.7.7.tar.gz
  • Upload date:
  • Size: 18.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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}

File hashes

Hashes for twat_audio-2.7.7.tar.gz
Algorithm Hash digest
SHA256 76ee15717e63fdf3b5475a6e8a48a95c2eb5fe5eeadf755dfaaf2cf0b8ea1f91
MD5 b7dd50f13e2f90f20d540ca0714a6daf
BLAKE2b-256 fb0f1dc7b78d6c5a2ec356b34e1aae44a222b0d0f97076192a992aa109bbe2a3

See more details on using hashes here.

File details

Details for the file twat_audio-2.7.7-py3-none-any.whl.

File metadata

  • Download URL: twat_audio-2.7.7-py3-none-any.whl
  • Upload date:
  • Size: 10.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","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}

File hashes

Hashes for twat_audio-2.7.7-py3-none-any.whl
Algorithm Hash digest
SHA256 b05a103b45858bcd5964d7a4ed73e82f9719f1e95146287b6c5d5bd45c2a4590
MD5 b6b611b0e0481d3ff4e6455123d43b92
BLAKE2b-256 fb5c90fa1204c43db83cb4bef5276e05eba9b470a9dfa53c272ef4bac88e6f12

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page