README.md 1.36 KB
Newer Older
Soumith Chintala's avatar
Soumith Chintala committed
1
torchaudio: an audio library for PyTorch
Soumith Chintala's avatar
Soumith Chintala committed
2
3
================================================

4
5
6
7
8
- [Support audio I/O (Load files, Save files)](http://pytorch.org/audio/)
  - Load the following formats into a torch Tensor
    - mp3, wav, aac, ogg, flac, avr, cdda, cvs/vms,
    - aiff, au, amr, mp2, mp4, ac3, avi, wmv,
    - mpeg, ircam and any other format supported by libsox.
9
    - [Kaldi (ark/scp)](http://pytorch.org/audio/kaldi_io.html)
10
11
12
- [Dataloaders for common audio datasets (VCTK, YesNo)](http://pytorch.org/audio/datasets.html)
- Common audio transforms
  - [Scale, PadTrim, DownmixMono, LC2CL, BLC2CBL, MuLawEncoding, MuLawExpanding](http://pytorch.org/audio/transforms.html)
Soumith Chintala's avatar
Soumith Chintala committed
13
14
15
16

Dependencies
------------
* libsox v14.3.2 or above
17
* [optional] vesis84/kaldi-io-for-python commit cb46cb1f44318a5d04d4941cf39084c5b021241e or above
Soumith Chintala's avatar
Soumith Chintala committed
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32

Quick install on
OSX (Homebrew):
```bash
brew install sox
```
Linux (Ubuntu):
```bash
sudo apt-get install sox libsox-dev libsox-fmt-all
```

Installation
------------

```bash
Soumith Chintala's avatar
Soumith Chintala committed
33
# Linux
Soumith Chintala's avatar
Soumith Chintala committed
34
python setup.py install
Soumith Chintala's avatar
Soumith Chintala committed
35

36
# OSX
Soumith Chintala's avatar
Soumith Chintala committed
37
MACOSX_DEPLOYMENT_TARGET=10.9 CC=clang CXX=clang++ python setup.py install
Soumith Chintala's avatar
Soumith Chintala committed
38
39
40
41
42
43
44
45
```

Quick Usage
-----------

```python
import torchaudio
sound, sample_rate = torchaudio.load('foo.mp3')
SeanNaren's avatar
SeanNaren committed
46
torchaudio.save('foo_save.mp3', sound, sample_rate) # saves tensor to file
Soumith Chintala's avatar
Soumith Chintala committed
47
48
49
50
```

API Reference
-----------
SeanNaren's avatar
SeanNaren committed
51

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