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,959 stars
BSD-2-Clause

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
81 /100 Excellent
Development Activity 76
Maintenance 60
Community 88
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
79 /100 Good
Architecture 78
Code Quality 80
Innovation 68
Learning Curve 90

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 10 apps in this directory

Python
100%
Apache 2.0

ClearML

Automation · Devops

6,915

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
68
Dependency
Built with
Python 100%
Updated 1 weeks ago
Python
100%
GPL 3.0

ComfyUI

AI Design Tools · AI Development

142,410

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
Python 100%
Updated 6 days ago
Python
99%
MIT

deepagents

AI Agents · AI Development

30,539

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
Python 99%
Updated 6 days ago
Python
84%
Other

fish-speech

AI Development · Developer Tools · Music Audio

33,377

SOTA open-source dual-autoregressive text-to-speech model with rapid voice cloning, inline emotion tags, and real-time streaming inference across 80+ languages.

View details
74
Repo Health
71
Technical
72
Dependency
Built with
Python 84%
TypeScript 12%
Updated 2 weeks ago
Python
66%
Other

Morphik

AI Development · Databases · Search

3,717

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
64
Repo Health
71
Technical
67
Dependency
Built with
Python 66%
TypeScript 23%
Updated 1 weeks ago
Rust
63%
MIT

PostgresML

AI Development · Databases

6,823

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
Rust 63%
JavaScript 11%
Updated 1 years ago
Python
87%
Apache 2.0

PrivateGPT

AI Development

57,611

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

View details
88
Repo Health
83
Technical
70
Dependency
Built with
Python 87%
Updated 1 weeks ago
Python
73%
Apache 2.0

Unsloth

AI Assistants · AI Development

78,493

Run and fine-tune LLMs, diffusion, audio and embedding models on your own hardware, from a native desktop app, a browser UI, or a Python library.

View details
89
Repo Health
83
Technical
70
Dependency
Built with
Python 73%
TypeScript 22%
Updated 6 days ago
Python
46%
MIT

Voicebox

AI Development · Productivity · Voice AI

58,409

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

View details
84
Repo Health
76
Technical
67
Dependency
Built with
Python 46%
TypeScript 42%
Updated 3 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