> ## Documentation Index
> Fetch the complete documentation index at: https://docs.pixeltable.com/llms.txt
> Use this file to discover all available pages before exploring further.

# audio

> <a href="https://github.com/pixeltable/pixeltable/blob/main/pixeltable/functions/audio.py#L0" id="viewSource" target="_blank" rel="noopener noreferrer"><img src="https://img.shields.io/badge/View%20Source%20on%20Github-blue?logo=github&labelColor=gray" alt="View Source on GitHub" style={{ display: 'inline', margin: '0px' }} noZoom /></a>

# <span style={{ 'color': 'gray' }}>module</span>  pixeltable.functions.audio

Pixeltable UDFs for `AudioType`.

## <span style={{ 'color': 'gray' }}>udf</span>  get\_metadata()

```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
get_metadata(audio: Audio) -> Json
```

Gets various metadata associated with an audio file and returns it as a dictionary.

**Parameters:**

* **`audio`** (`Audio`): The audio to get metadata for.

**Returns:**

* `Json`: A `dict` such as the following:
  ```json theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
  {
      'size': 2568827,
      'streams': [
          {
              'type': 'audio',
              'frames': 0,
              'duration': 2646000,
              'metadata': {},
              'time_base': 2.2675736961451248e-05,
              'codec_context': {
                  'name': 'flac',
                  'profile': None,
                  'channels': 1,
                  'codec_tag': '\x00\x00\x00\x00',
              },
              'duration_seconds': 60.0,
          }
      ],
      'bit_rate': 342510,
      'metadata': {'encoder': 'Lavf61.1.100'},
      'bit_exact': False,
  }
  ```

**Examples:**

Extract metadata for files in the `audio_col` column of the table `tbl`:

```python theme={"theme":{"light":"light-plus","dark":"dark-plus"}}
tbl.select(tbl.audio_col.get_metadata()).collect()
```
