# Transcript

URL: https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/transcript/

Defined in: [transcript.ts:64](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/transcript.ts#L64)

What a listener has read of one audio track's transcript: each segment's latest version, less what was cut.
`apply` each segment read for the track and `cut` on each interrupt for it; `linesAt` gives what to show as the
audio plays. A segment's final version is kept against later ones. Cuts are remembered, so a version that arrives
after one is clipped as if it had arrived before. A segment is known by its `seq` within one run of the talker's
track, so create a new transcript when the talker starts over.

## Properties

### lines

```ts
readonly lines: TranscriptLine[];
```

Defined in: [transcript.ts:79](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/transcript.ts#L79)

Every segment held, in timeline order.

## Methods

### apply()

```ts
apply(segment): boolean;
```

Defined in: [transcript.ts:71](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/transcript.ts#L71)

Keep a segment's version, clipped by the cuts so far; `false` if it changed nothing. Ignored: a version of a
segment the talker already sent final, a segment that starts inside a range cut earlier (as audio arriving there
late is), and an interim version of a segment a cut ended. A cut segment takes the talker's final version,
clipped: one whose audio ended before the cut is no longer cut.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `segment` | [`TranscriptSegment`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/transcriptsegment/) |

#### Returns

`boolean`

***

### cut()

```ts
cut(range, positionUs?): void;
```

Defined in: [transcript.ts:77](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/transcript.ts#L77)

Apply an interrupt's range, with the playout position now (`PlayoutClock.position()`). Audio before the position
has been heard, so the cut starts at the later of `fromUs` and the position. It drops the segments that start in
the cut, and ends the one playing there at its start, final and cut.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `range` | [`TranscriptCutRange`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/transcriptcutrange/) |
| `positionUs?` | `number` |

#### Returns

`void`

***

### linesAt()

```ts
linesAt(positionUs): TranscriptLine[];
```

Defined in: [transcript.ts:81](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/transcript.ts#L81)

The segments whose audio has started playing at this position, in timeline order; none while idle.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `positionUs` | `number` \| `undefined` |

#### Returns

[`TranscriptLine`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/transcriptline/)[]
