(If you do not have torch already installed, this will default to installing
torch from PyPI. If you need a different torch configuration, preinstall torch
- 执行编译命令
before running this command.)
```shell
cd audio
### Nightly build
CXX=hipcc CC=hipcc python3 setup.py bdist_wheel
pip install dist/torchaudio*
Note that nightly build is built on PyTorch's nightly build. Therefore, you need to install the latest PyTorch when you use nightly build of torchaudio.
On non-Windows platforms, the build process builds libsox and codecs that torchaudio need to link to. It will fetch and build libmad, lame, flac, vorbis, opus, and libsox before building extension. This process requires `cmake` and `pkg-config`. libsox-based features can be disabled with `BUILD_SOX=0`.
The build process also builds the RNN transducer loss. This functionality can be disabled by setting the environment variable `BUILD_RNNT=0`.
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/
Contributing Guidelines
-----------------------
Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md)
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!
(If you do not have torch already installed, this will default to installing
torch from PyPI. If you need a different torch configuration, preinstall torch
before running this command.)
### Nightly build
Note that nightly build is built on PyTorch's nightly build. Therefore, you need to install the latest PyTorch when you use nightly build of torchaudio.
On non-Windows platforms, the build process builds libsox and codecs that torchaudio need to link to. It will fetch and build libmad, lame, flac, vorbis, opus, and libsox before building extension. This process requires `cmake` and `pkg-config`. libsox-based features can be disabled with `BUILD_SOX=0`.
The build process also builds the RNN transducer loss. This functionality can be disabled by setting the environment variable `BUILD_RNNT=0`.
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/
Contributing Guidelines
-----------------------
Please refer to [CONTRIBUTING.md](./CONTRIBUTING.md)
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!