{"id":6586,"library":"descript-audiotools","title":"Descript Audiotools","description":"Descript Audiotools is a Python library providing object-oriented handling of audio data, featuring functionalities like fast augmentation routines, batching, padding, and GPU-powered operations. The current stable version available on PyPI is 0.7.2. The library is actively maintained, with development continuing on its GitHub repository.","status":"active","version":"0.7.2","language":"en","source_language":"en","source_url":"https://github.com/descriptinc/audiotools","tags":["audio","signal processing","deep learning","sound","machine learning"],"install":[{"cmd":"pip install descript-audiotools","lang":"bash","label":"Install from PyPI"}],"dependencies":[{"reason":"Specific version range required, commonly causes conflicts.","package":"protobuf","optional":false}],"imports":[{"note":"AudioSignal is a class directly exported from the top-level package.","wrong":"import audiotools.AudioSignal","symbol":"AudioSignal","correct":"from audiotools import AudioSignal"},{"symbol":"audiotools","correct":"import audiotools"}],"quickstart":{"code":"import audiotools\nimport numpy as np\n\n# Create a dummy AudioSignal (e.g., a sine wave)\nsample_rate = 44100\nduration = 3 # seconds\nfrequency = 440 # Hz\nt = np.linspace(0, duration, int(sample_rate * duration), endpoint=False)\nsine_wave = 0.5 * np.sin(2 * np.pi * frequency * t)\n\n# AudioSignal expects a torch.Tensor, so convert numpy array\nsignal = audiotools.AudioSignal(sine_wave[np.newaxis, :], sample_rate)\n\nprint(f\"Original signal sample rate: {signal.sample_rate}\")\nprint(f\"Original signal duration: {signal.duration} seconds\")\n\n# Apply a low-pass filter\nfiltered_signal = signal.low_pass(8000)\nprint(f\"Filtered signal duration: {filtered_signal.duration} seconds\")\n\n# To play back audio, ffplay (part of FFmpeg) must be installed.\n# signal.play() \n# filtered_signal.play()","lang":"python","description":"This quickstart demonstrates how to create a basic `AudioSignal` object, apply a simple audio transformation (low-pass filter), and print its properties. For actual audio playback using `signal.play()`, the `ffplay` utility (part of the FFmpeg suite) needs to be installed and accessible in your system's PATH. The example generates a dummy sine wave for immediate execution without external audio files."},"warnings":[{"fix":"Ensure your environment uses `protobuf` within the `3.9.2` to `3.19.x` range. You may need to downgrade `protobuf` if other packages require a newer version, or consider installing `audiotools` directly from GitHub if a newer, compatible version exists there (e.g., `pip install git+https://github.com/descriptinc/audiotools@main`).","message":"Version 0.7.2 of `descript-audiotools` has a strict dependency on `protobuf<3.20,>=3.9.2`. Installing with newer `protobuf` versions (e.g., 4.x or 5.x) will lead to dependency conflicts and prevent installation or cause runtime errors.","severity":"breaking","affected_versions":"0.7.2 and potentially earlier/later versions if not updated."},{"fix":"Install FFmpeg (which includes `ffplay`) on your operating system and ensure its executables are accessible via your system's PATH. Common installation methods include `brew install ffmpeg` on macOS, `sudo apt-get install ffmpeg` on Debian/Ubuntu, or downloading from the official FFmpeg website for Windows.","message":"The `AudioSignal.play()` method relies on the external `ffplay` command-line utility for audio playback. If `ffplay` (part of FFmpeg) is not installed on your system or not in your system's PATH, `signal.play()` calls will fail silently or with an error about the command not being found.","severity":"gotcha","affected_versions":"All versions utilizing `signal.play()`."}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z","problems":[]}