We are currently solving the following issue within our repository. Here is the issue text:
--- BEGIN ISSUE ---
Making `AudioMetaData` print friendly
`AudioMetaData` class reports meta-data of audio source. It is however not print friendly.

```python
print(torchaudio.info(src))
>>> <torchaudio.backend.common.AudioMetaData object at 0x7f1bc5cd2890>
```

It is nice if we can simply print the attributes like `dataclass` objects do.

```python
print(torchaudio.info(src))
>>> AudioMetaData(sample_rate=900, encoding="PCM", ...)
```

## Steps

There are two approaches I can think of
1. Add `__str__` method.
2. Use `dataclasses.dataclass`

For 2, the `info` function has to be TorchScript-compatible. This means that its return type `AudioMetaData` has to be TorchScript-able. For this reason, `dataclass` might not be applicable. This can be checked with the following test;

```bash
(cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py)
```

## Build and test

Please refer to the [contribution guide](https://github.com/pytorch/audio/blob/master/CONTRIBUTING.md) for how to setup development environment.

To test, 

```bash
(cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py torchaudio_unittest/backend/sox_io/info_test.py torchaudio_unittest/backend/soundfile_io/info_test.py)
```

--- END ISSUE ---

Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
--- BEGIN FILES ---
Path: `torchaudio/backend/common.py`
Content:
```
1 class AudioMetaData:
2     """Return type of ``torchaudio.info`` function.
3 
4     This class is used by :ref:`"sox_io" backend<sox_io_backend>` and
5     :ref:`"soundfile" backend with the new interface<soundfile_backend>`.
6 
7     :ivar int sample_rate: Sample rate
8     :ivar int num_frames: The number of frames
9     :ivar int num_channels: The number of channels
10     :ivar int bits_per_sample: The number of bits per sample. This is 0 for lossy formats,
11         or when it cannot be accurately inferred.
12     :ivar str encoding: Audio encoding
13         The values encoding can take are one of the following:
14 
15             * ``PCM_S``: Signed integer linear PCM
16             * ``PCM_U``: Unsigned integer linear PCM
17             * ``PCM_F``: Floating point linear PCM
18             * ``FLAC``: Flac, Free Lossless Audio Codec
19             * ``ULAW``: Mu-law
20             * ``ALAW``: A-law
21             * ``MP3`` : MP3, MPEG-1 Audio Layer III
22             * ``VORBIS``: OGG Vorbis
23             * ``AMR_WB``: Adaptive Multi-Rate
24             * ``AMR_NB``: Adaptive Multi-Rate Wideband
25             * ``OPUS``: Opus
26             * ``UNKNOWN`` : None of above
27     """
28     def __init__(
29             self,
30             sample_rate: int,
31             num_frames: int,
32             num_channels: int,
33             bits_per_sample: int,
34             encoding: str,
35     ):
36         self.sample_rate = sample_rate
37         self.num_frames = num_frames
38         self.num_channels = num_channels
39         self.bits_per_sample = bits_per_sample
40         self.encoding = encoding
41
```
--- END FILES ---

Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.

Here is an example:

```diff
diff --git a/examples/server_async.py b/examples/server_async.py
--- a/examples/server_async.py
+++ b/examples/server_async.py
@@ -313,4 +313,4 @@
 
 
 if __name__ == "__main__":
-    asyncio.run(run_async_server("."), debug=True)
+    asyncio.run(run_async_server(), debug=True)
diff --git a/examples/server_sync.py b/examples/server_sync.py
--- a/examples/server_sync.py
+++ b/examples/server_sync.py
@@ -313,5 +313,5 @@
 
 
 if __name__ == "__main__":
-    server = run_sync_server(".")
+    server = run_sync_server()
     server.shutdown()

```

diff --git a/torchaudio/backend/common.py b/torchaudio/backend/common.py
--- a/torchaudio/backend/common.py
+++ b/torchaudio/backend/common.py
@@ -38,3 +38,14 @@
         self.num_channels = num_channels
         self.bits_per_sample = bits_per_sample
         self.encoding = encoding
+
+    def __str__(self):
+        return (
+            f"AudioMetaData("
+            f"sample_rate={self.sample_rate}, "
+            f"num_frames={self.num_frames}, "
+            f"num_channels={self.num_channels}, "
+            f"bits_per_sample={self.bits_per_sample}, "
+            f"encoding={self.encoding}"
+            f")"
+        )

{"golden_diff": "diff --git a/torchaudio/backend/common.py b/torchaudio/backend/common.py\n--- a/torchaudio/backend/common.py\n+++ b/torchaudio/backend/common.py\n@@ -38,3 +38,14 @@\n         self.num_channels = num_channels\n         self.bits_per_sample = bits_per_sample\n         self.encoding = encoding\n+\n+    def __str__(self):\n+        return (\n+            f\"AudioMetaData(\"\n+            f\"sample_rate={self.sample_rate}, \"\n+            f\"num_frames={self.num_frames}, \"\n+            f\"num_channels={self.num_channels}, \"\n+            f\"bits_per_sample={self.bits_per_sample}, \"\n+            f\"encoding={self.encoding}\"\n+            f\")\"\n+        )\n", "issue": "Making `AudioMetaData` print friendly\n`AudioMetaData` class reports meta-data of audio source. It is however not print friendly.\r\n\r\n```python\r\nprint(torchaudio.info(src))\r\n>>> <torchaudio.backend.common.AudioMetaData object at 0x7f1bc5cd2890>\r\n```\r\n\r\nIt is nice if we can simply print the attributes like `dataclass` objects do.\r\n\r\n```python\r\nprint(torchaudio.info(src))\r\n>>> AudioMetaData(sample_rate=900, encoding=\"PCM\", ...)\r\n```\r\n\r\n## Steps\r\n\r\nThere are two approaches I can think of\r\n1. Add `__str__` method.\r\n2. Use `dataclasses.dataclass`\r\n\r\nFor 2, the `info` function has to be TorchScript-compatible. This means that its return type `AudioMetaData` has to be TorchScript-able. For this reason, `dataclass` might not be applicable. This can be checked with the following test;\r\n\r\n```bash\r\n(cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py)\r\n```\r\n\r\n## Build and test\r\n\r\nPlease refer to the [contribution guide](https://github.com/pytorch/audio/blob/master/CONTRIBUTING.md) for how to setup development environment.\r\n\r\nTo test, \r\n\r\n```bash\r\n(cd test && pytest torchaudio_unittest/backend/sox_io/torchscript_test.py torchaudio_unittest/backend/sox_io/info_test.py torchaudio_unittest/backend/soundfile_io/info_test.py)\r\n```\n", "before_files": [{"content": "class AudioMetaData:\n    \"\"\"Return type of ``torchaudio.info`` function.\n\n    This class is used by :ref:`\"sox_io\" backend<sox_io_backend>` and\n    :ref:`\"soundfile\" backend with the new interface<soundfile_backend>`.\n\n    :ivar int sample_rate: Sample rate\n    :ivar int num_frames: The number of frames\n    :ivar int num_channels: The number of channels\n    :ivar int bits_per_sample: The number of bits per sample. This is 0 for lossy formats,\n        or when it cannot be accurately inferred.\n    :ivar str encoding: Audio encoding\n        The values encoding can take are one of the following:\n\n            * ``PCM_S``: Signed integer linear PCM\n            * ``PCM_U``: Unsigned integer linear PCM\n            * ``PCM_F``: Floating point linear PCM\n            * ``FLAC``: Flac, Free Lossless Audio Codec\n            * ``ULAW``: Mu-law\n            * ``ALAW``: A-law\n            * ``MP3`` : MP3, MPEG-1 Audio Layer III\n            * ``VORBIS``: OGG Vorbis\n            * ``AMR_WB``: Adaptive Multi-Rate\n            * ``AMR_NB``: Adaptive Multi-Rate Wideband\n            * ``OPUS``: Opus\n            * ``UNKNOWN`` : None of above\n    \"\"\"\n    def __init__(\n            self,\n            sample_rate: int,\n            num_frames: int,\n            num_channels: int,\n            bits_per_sample: int,\n            encoding: str,\n    ):\n        self.sample_rate = sample_rate\n        self.num_frames = num_frames\n        self.num_channels = num_channels\n        self.bits_per_sample = bits_per_sample\n        self.encoding = encoding\n", "path": "torchaudio/backend/common.py"}], "after_files": [{"content": "class AudioMetaData:\n    \"\"\"Return type of ``torchaudio.info`` function.\n\n    This class is used by :ref:`\"sox_io\" backend<sox_io_backend>` and\n    :ref:`\"soundfile\" backend with the new interface<soundfile_backend>`.\n\n    :ivar int sample_rate: Sample rate\n    :ivar int num_frames: The number of frames\n    :ivar int num_channels: The number of channels\n    :ivar int bits_per_sample: The number of bits per sample. This is 0 for lossy formats,\n        or when it cannot be accurately inferred.\n    :ivar str encoding: Audio encoding\n        The values encoding can take are one of the following:\n\n            * ``PCM_S``: Signed integer linear PCM\n            * ``PCM_U``: Unsigned integer linear PCM\n            * ``PCM_F``: Floating point linear PCM\n            * ``FLAC``: Flac, Free Lossless Audio Codec\n            * ``ULAW``: Mu-law\n            * ``ALAW``: A-law\n            * ``MP3`` : MP3, MPEG-1 Audio Layer III\n            * ``VORBIS``: OGG Vorbis\n            * ``AMR_WB``: Adaptive Multi-Rate\n            * ``AMR_NB``: Adaptive Multi-Rate Wideband\n            * ``OPUS``: Opus\n            * ``UNKNOWN`` : None of above\n    \"\"\"\n    def __init__(\n            self,\n            sample_rate: int,\n            num_frames: int,\n            num_channels: int,\n            bits_per_sample: int,\n            encoding: str,\n    ):\n        self.sample_rate = sample_rate\n        self.num_frames = num_frames\n        self.num_channels = num_channels\n        self.bits_per_sample = bits_per_sample\n        self.encoding = encoding\n\n    def __str__(self):\n        return (\n            f\"AudioMetaData(\"\n            f\"sample_rate={self.sample_rate}, \"\n            f\"num_frames={self.num_frames}, \"\n            f\"num_channels={self.num_channels}, \"\n            f\"bits_per_sample={self.bits_per_sample}, \"\n            f\"encoding={self.encoding}\"\n            f\")\"\n        )\n", "path": "torchaudio/backend/common.py"}]}