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

# read_audio

> Read audio files as a SQL table, one row per time window.

`read_audio` divides each recording into fixed time windows and returns one row per window. Each row has the speech from that window in `transcript`.

See [Models](https://docs.chowder.ai/concepts/models.md) for the transcription model.

## Signature

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
read_audio(pattern [, window_s])
```

| Parameter | Type | Default | Description |
| - | - | - | - |
| `pattern` | `VARCHAR` | — | An audio file, directory, glob, or supported remote URI. |
| `window_s` | Positive number literal | `5` | Length of each window, in seconds. |

Supported extensions: `.mp3`, `.wav`, `.flac`, `.m4a`, `.aac`, `.ogg`, `.oga`, `.opus`, and `.wma`.

## Example

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
SELECT
    source,
    window_number,
    start_s,
    end_s,
    transcript
FROM read_audio('hf://buckets/chowderai/chowder-demo/audio/data/steve-jobs-on-passion.mp3')
LIMIT 5;
```

## Columns

| Column | Type | Description |
| - | - | - |
| `source` | `VARCHAR` | Input path or URI. |
| `window_number` | `BIGINT` | One-based window number. |
| `window_count` | `BIGINT` | Total windows in the recording, when known. |
| `start_s`, `end_s` | `DOUBLE` | Window boundaries in seconds. |
| `duration_s` | `DOUBLE` | Length of the whole recording, in seconds. |
| `transcript` | `ARRAY<STRUCT>` | Timestamped speech segments that start in the window. |
| `metadata` | `STRUCT<error VARCHAR>` | `error`: why the audio or transcript failed. Null otherwise. |

Each transcript item contains `start_s`, `end_s`, and `text`.

A null transcript indicates a failure or that transcription was not produced. An empty list means no speech. Files larger than `CHOWDER_MAX_FILE_MB` (500 MB by default) are skipped with a warning and produce no rows. A remote server can set its own limit. See [Configuration](https://docs.chowder.ai/reference/configuration.md).

## Expand windows into transcript segments

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
SELECT
    source,
    unnest(transcript) AS segment -- Expand timestamped speech into segment rows
FROM read_audio('hf://buckets/chowderai/chowder-demo/audio/data/steve-jobs-on-passion.mp3')
WHERE window_number <= 12; -- Analyze the first 60 seconds with default 5-second windows
```

## Set the window duration

Pass the window size in seconds as the second argument. For example, use 30-second windows with:

```chowder-sql theme={"theme":"css-variables","languages":{"custom":["/languages/chowder-sql.json"]}}
SELECT
    source,
    window_number,
    start_s,
    end_s
FROM read_audio('hf://buckets/chowderai/chowder-demo/audio/data/steve-jobs-on-passion.mp3', 30)
LIMIT 5;
```

## Execution

* `count(*)` uses each file's duration header when available, without decoding or transcribing the audio.
* Transcription runs only when the query selects `transcript`.
* `LIMIT` stops decoding once the query has enough rows.
* Transcription runs locally with whisper.cpp, or on the server with remote compute. Use `LocalTranscriptionConfig` to choose the local model.

See [Caching](https://docs.chowder.ai/concepts/caching.md) for result reuse, cache validity, and cache controls.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.