Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

torchaudio: an audio library for PyTorch

Documentation Anaconda Badge Anaconda-Server Badge

TorchAudio Logo

The aim of torchaudio is to apply PyTorch to the audio domain. By supporting PyTorch, torchaudio follows the same philosophy of providing strong GPU acceleration, having a focus on trainable features through the autograd system, and having consistent style (tensor names and dimension names). Therefore, it is primarily a machine learning library and not a general signal processing library. The benefits of PyTorch can be seen in torchaudio through having all the computations be through PyTorch operations which makes it easy to use and feel like a natural extension.

Installation

Please refer to https://pytorch.org/audio/main/installation.html for installation and build process of TorchAudio.

Quick Usage

import torchaudio

waveform, sample_rate = torchaudio.load('foo.wav')  # load tensor from file
torchaudio.save('foo_save.wav', waveform, sample_rate)  # save tensor to file

Backend Dispatch

By default in OSX and Linux, torchaudio uses SoX as a backend to load and save files. The backend can be changed to SoundFile using the following. See SoundFile for installation instructions.

import torchaudio
torchaudio.set_audio_backend("soundfile")  # switch backend

waveform, sample_rate = torchaudio.load('foo.wav')  # load tensor from file, as usual
torchaudio.save('foo_save.wav', waveform, sample_rate)  # save tensor to file, as usual

Note

  • SoundFile currently does not support mp3.
  • "soundfile" backend is not supported by TorchScript.

API Reference

API Reference is located here: http://pytorch.org/audio/main/

Contributing Guidelines

Please refer to CONTRIBUTING.md

Citation

If you find this package useful, please cite as:

@article{yang2021torchaudio,
  title={TorchAudio: Building Blocks for Audio and Speech Processing},
  author={Yao-Yuan Yang and Moto Hira and Zhaoheng Ni and Anjali Chourdia and Artyom Astafurov and Caroline Chen and Ching-Feng Yeh and Christian Puhrsch and David Pollack and Dmitriy Genzel and Donny Greenberg and Edward Z. Yang and Jason Lian and Jay Mahadeokar and Jeff Hwang and Ji Chen and Peter Goldsborough and Prabhat Roy and Sean Narenthiran and Shinji Watanabe and Soumith Chintala and Vincent Quenneville-Bélair and Yangyang Shi},
  journal={arXiv preprint arXiv:2110.15018},
  year={2021}
}

Disclaimer on Datasets

This is a utility library that downloads and prepares public datasets. We do not host or distribute these datasets, vouch for their quality or fairness, or claim that you have license to use the dataset. It is your responsibility to determine whether you have permission to use the dataset under the dataset's license.

If you're a dataset owner and wish to update any part of it (description, citation, etc.), or do not want your dataset to be included in this library, please get in touch through a GitHub issue. Thanks for your contribution to the ML community!

Pre-trained Model License

The pre-trained models provided in this library may have their own licenses or terms and conditions derived from the dataset used for training. It is your responsibility to determine whether you have permission to use the models for your use case.

For instance, SquimSubjective model is released under the Creative Commons Attribution Non Commercial 4.0 International (CC-BY-NC 4.0) license. See the link for additional details.

Other pre-trained models that have different license are noted in documentation. Please checkout the documentation page.

Release files for gladia-torchaudio 2.1.0a0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for gladia-torchaudio 2.1.0a0
File Size Uploaded
gladia-torchaudio-2.1.0a0.tar.gz 267.4 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for gladia-torchaudio 2.1.0a0
File Interpreter ABI Platform
gladia_torchaudio-2.1.0a0-py3.8-linux-x86_64.egg Legacy Egg format - - Details
gladia_torchaudio-2.1.0a0-py3-none-any.whl Python 3 none any Details

Total release size: 5.9 MB

Release files / gladia-torchaudio-2.1.0a0.tar.gz

Download URL gladia-torchaudio-2.1.0a0.tar.gz
Size 267.4 kB
Tags Source
SHA-256 checksum
How to use checksums
6387650da4933e6b8f712e4428192333820f4bcf86676d8d84cb6f50286b4da8
BLAKE2b-256 checksum
How to use checksums
ba5673c823ae055c5a265a9162744a3e4928cd43644724682ec0358a0586bc37
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.16

Release files / gladia_torchaudio-2.1.0a0-py3.8-linux-x86_64.egg

Download URL gladia_torchaudio-2.1.0a0-py3.8-linux-x86_64.egg
Size 3.0 MB
Tags Egg
SHA-256 checksum
How to use checksums
89c402f2c3eb2d6cc16627dd7d74219a5c3f1600d0fb59ccb183ec0ce359a6bc
BLAKE2b-256 checksum
How to use checksums
bec6f26332bead1b0767e5ceedf99344a73621e7a2fbeb1c63c25db19cb70763
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.16

Release files / gladia_torchaudio-2.1.0a0-py3-none-any.whl

Download URL gladia_torchaudio-2.1.0a0-py3-none-any.whl
Size 2.6 MB
Tags Python 3
SHA-256 checksum
How to use checksums
816cde24433550c42722d05d324fe93e07e672ed67bcdd25bafdab660cd9f8bc
BLAKE2b-256 checksum
How to use checksums
dffadc9c0b4bdfafbee330f88524743e92b053cbe3f3e651b4e3840a89b5a1bb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.8.16

Release history Release notifications | RSS feed

This release

2.1.0a0 This release

3 release files

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