torchaudio

GPU-accelerated audio processing library built on PyTorch, with differentiable transforms, Kaldi-compatible features, and pretrained speech models.

Library
PyPI
v2.11.0
2,933stars
BSD-2-Clause

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
75/100Good
Development Activity64
Maintenance48
Community88
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
79/100Good
Architecture78
Code Quality80
Innovation68
Learning Curve90

torchaudio extends PyTorch into the audio domain, giving machine learning practitioners GPU-accelerated tensor operations for transforming and modeling audio and speech data. Rather than acting as a general signal-processing library, it is scoped specifically to the operations that matter for training audio ML models: differentiable transforms through PyTorch’s autograd system, consistent tensor and dimension naming, and tight integration with the rest of the PyTorch ecosystem.

As of the 2.9 release the library has moved into a maintenance phase, narrowing its scope: audio decoding and encoding are now delegated to the sibling torchcodec project, while torchaudio itself focuses on spectrogram and filter transforms, Kaldi-compatible compliance functions, forced alignment, and reference model architectures (Wav2Vec2, Conformer, Tacotron2, HDemucs, and more) alongside their pretrained pipelines.

What You Get

  • Differentiable audio transforms (Spectrogram, MelSpectrogram, MFCC, Resample, and more) built as PyTorch nn.Module classes with autograd support
  • A Kaldi-compatible compliance layer for spectrogram, fbank, and mfcc feature extraction
  • Pretrained model architectures and pipelines for speech recognition, forced alignment, and source separation (Wav2Vec2, Conformer, HDemucs, Tacotron2)
  • Dataset loaders for two dozen standard speech and audio corpora (LibriSpeech, CommonVoice, VCTK, MUSDB-HQ, and others)
  • Low-level functional building blocks for custom DSP pipelines, from mu-law encoding to multi-channel beamforming

Common Use Cases

  • Training speech recognition or TTS models on GPU with differentiable spectrogram transforms
  • Extracting Kaldi-compatible MFCC/fbank features for compatibility with existing ASR pipelines
  • Building audio source-separation systems using the bundled HDemucs model
  • Benchmarking against standard speech datasets (LibriSpeech, VoxCeleb, TEDLIUM) via built-in loaders

Under The Hood

Architecture torchaudio is organized as a layered PyTorch extension: at the base sit native C++/CUDA kernels (RNNT loss, CUCTC, forced alignment) compiled into a native extension loaded through the package’s extension-init module; above that sits a functional layer providing stateless tensor operations, then transforms wrapping those functionals as nn.Module classes for use inside a training graph, and finally model and pipeline modules compose transforms and functionals into full architectures (Wav2Vec2, HDemucs, Conformer) paired with pretrained-weight pipeline wrappers, with dataset loaders sitting alongside as a parallel data layer. This is a conventional layered library architecture with clear separation of concerns; the main coupling risk is that models and pipelines depend on exact functional signatures, so a change to a core transform’s tensor-shape convention would ripple through every downstream pipeline.

Tech Stack Built for Python 3.8+ with setuptools, depending at runtime on torch (required) and optionally torchcodec for audio decode/encode now that I/O has been delegated out of the core package. Native code is C++/CUDA, compiled per-platform through dedicated GitHub Actions wheel-build workflows for Linux, Windows, aarch64, and macOS; linting runs through flake8 and black/usort (configured in pyproject.toml) enforced via pre-commit hooks, with Sphinx-generated docs published to pytorch.org/audio.

Code Quality Tests live under a mirrored unittest tree covering transforms, functional, models, datasets, compliance, and utils, plus separate integration and smoke-test suites built on shared test-utility helpers, with autograd-consistency tests exercising CPU/CUDA/quantized code paths in parallel. CI runs dedicated unittest workflows for Linux, Windows, and macOS (CPU and GPU variants) alongside a bandit security scan and a standalone lint workflow. Type hints are present throughout the functional API though not exhaustively enforced by a strict mypy configuration, and no obvious swallowed-exception patterns turned up in the sampled source.

API Design The public API mirrors idiomatic PyTorch conventions closely: transforms are nn.Module subclasses that compose with Sequential and DataParallel, and a stateless functional equivalent exists for every transform. The Kaldi-compliance namespace is a deliberate ergonomic bridge for teams migrating existing Kaldi feature-extraction pipelines without a mismatch in output values — a well-executed compatibility layer rather than a novel algorithm. Documentation maps closely to the API surface, and the README states an explicit versioning contract decoupling TorchAudio releases from torch upgrades. Its distinguishing value is being a tightly-integrated adapter/toolkit into the PyTorch ecosystem rather than inventing new signal-processing methods.

Used by 7 apps in this directory

Python
100%
Apache 2.0

ClearML

Devops · Automation

6,858

Auto-magical MLOps platform that tracks experiments, versions data, orchestrates pipelines, and serves models with just two lines of code.

View details
95
Repo Health
79
Technical
67
Dependency
Built with
Python100%
Updated yesterday
Python
100%
GPL 3.0

ComfyUI

AI Design Tools · AI Development

131,801

The most powerful node-based AI workflow engine for creating images, video, 3D models, and audio with full control over every generation step.

View details
92
Repo Health
81
Technical
75
Dependency
Built with
Python100%
Updated today
Python
99%
MIT

deepagents

AI Agents · AI Development

29,067

The batteries-included Python agent harness — planning, sub-agents, filesystem, shell, memory, and skills bundled in, built on LangGraph.

View details
88
Repo Health
83
Technical
70
Dependency
Built with
Python99%
Updated yesterday
Python
67%
Other

Morphik

AI Development · Search · Databases

3,710

Morphik is an AI-native ingestion and retrieval engine that lets developers store, search, and reason over visually rich documents — scanned PDFs, manuals, slides, and video — without duct-taping together OCR, an embedding model, and a vector database.

View details
61
Repo Health
71
Technical
67
Dependency
Built with
Python67%
TypeScript25%
Updated 3 days ago
Rust
63%
MIT

PostgresML

Databases · AI Development

6,819

Run ML training and LLM inference natively inside PostgreSQL with GPU acceleration — no data movement required.

View details
51
Repo Health
76
Technical
64
Dependency
Built with
Rust63%
JavaScript11%
Updated 1 years ago
Python
86%
Apache 2.0

PrivateGPT

AI Development

57,494

The open-source API layer that turns local LLMs into production private AI applications with full Claude API compatibility

View details
87
Repo Health
83
Technical
69
Dependency
Built with
Python86%
HTML10%
Updated 4 days ago
TypeScript
53%
MIT

Voicebox

AI Development · Productivity

52,436

Clone voices, dictate anywhere, and give AI agents your voice — all locally.

View details
82
Repo Health
76
Technical
68
Dependency
Built with
TypeScript53%
Python35%
Updated 4 weeks ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers

Search