# gizai/tasks/transcription

the speech-to-text task. A model family that hears speech gives a Transcriber (gizai/family's `transcriber`): `hear` gives the text spoken in 16 kHz mono samples, in a language the model names ("" or "auto": the model finds it).

```gizlang
import * as Transcription from "gizai/tasks/transcription";
```

## Types

### `Transcriber`

```gizlang
type Transcriber = { hear: (samples: Vec<f32>, language: string) => string throws string; }
```

A speech model: `hear` gives the text spoken in samples at RATE, in `language` ("" or "auto": the model finds it).

- `hear`: `(samples: Vec<f32>, language: string) => string throws string`

## Functions

### `samplesOf`

```gizlang
function samplesOf(ffmpeg: string, data: bytes, rate: i64 = RATE): Vec<f32> throws string
```

The mono samples at `rate` (16 kHz by default) of a recording in any format the program `ffmpeg` reads (WebM, Ogg,
MP3, WAV, ...).

Effects: fail, read, write, console, io, alloc.

## Constants

### `RATE`

```gizlang
const RATE: i64 = 16000
```

The rate of the samples a Transcriber hears.

