{ "cells": [ { "cell_type": "markdown", "metadata": {}, "source": [ "\n# Audio I/O\n\nThis tutorial shows how to use TorchAudio's basic I/O API to load audio files\ninto PyTorch's Tensor object, and save Tensor objects to audio files.\n" ] }, { "cell_type": "code", "execution_count": null, "metadata": { "collapsed": false }, "outputs": [], "source": [ "import torch\nimport torchaudio\n\nprint(torch.__version__)\nprint(torchaudio.__version__)" ] }, { "cell_type": "markdown", "metadata": {}, "source": [ "## Preparation\n\nFirst, we import the modules and download the audio assets we use in this tutorial.\n\n
When running this tutorial in Google Colab, install the required packages\n with the following:\n\n .. code::\n\n !pip install boto3
When passing a file-like object, ``info`` does not read\n all of the underlying data; rather, it reads only a portion\n of the data from the beginning.\n Therefore, for a given audio format, it may not be able to retrieve the\n correct metadata, including the format itself. In such case, you\n can pass ``format`` argument to specify the format of the audio.