# gizai/tasks/speech

text to speech. A speech model of the catalog (Family.speaker) says a text in a voice: one cloned from a recording, or one described in words.

```gizlang
import * as Speech from "gizai/tasks/speech";
```

## Types

### `Voice`

```gizlang
type Voice = { samples: Vec<f32>; text: string; described: string; language: string; }
```

A voice: a recording (`samples` at the speaker's rate) and the words said in it, else a description in words
("female, young adult, moderate pitch"; "": the model's own). `language`: a code, or "" for the model's guess.

- `samples`: `Vec<f32>`
- `text`: `string`
- `described`: `string`
- `language`: `string`

### `Speaker`

```gizlang
type Speaker = { rate: i64; say: (text: string, voice: Voice) => Vec<f32> throws string; }
```

A speech model: its sample rate, and `say`, the mono samples of `text` in `voice`.

- `rate`: `i64`
- `say`: `(text: string, voice: M83.Voice) => Vec<f32> throws string`

## Functions

### `ownVoice`

```gizlang
function ownVoice(): Voice
```

The model's own voice.

