# ReplaceableTrackOptions

URL: https://www.caprid.com/docs/reference/typescript/caprid/relay/media/interfaces/replaceabletrackoptions/

Defined in: [relay-sdks/ts/src/replaceable-track.ts:25](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L25)

Options for [createReplaceableTrack](https://www.caprid.com/docs/reference/typescript/caprid/relay/media/functions/createreplaceabletrack/).

## Type Parameters

| Type Parameter | Default type |
| ------ | ------ |
| <a id="type-parameter-f"></a> `F` *extends* [`Frame`](https://www.caprid.com/docs/reference/typescript/caprid/relay/media/interfaces/frame/) | [`Frame`](https://www.caprid.com/docs/reference/typescript/caprid/relay/media/interfaces/frame/) |

## Properties

### catalog

```ts
catalog: ReplaceableTrackCatalog;
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:42](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L42)

The catalog to list the current track in.

***

### demandWaitMs?

```ts
demandWaitMs?: number;
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:50](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L50)

How long frames written to a replacement wait for its first relay subscription, in milliseconds. A listener
subscribes to a replacement only once the new catalog has reached it, about a round trip, and a frame writer
skips what it is handed before then: the first words of the new reply. The frames wait, in order, and go out once
the relay subscribes; any still waiting when this runs out go to the writer, which skips them. 0 waits for
nothing. Default 2000.

***

### name?

```ts
name?: (replacement) => string;
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:34](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L34)

The name of the track that replacement attempt number `replacement` (1 for the first) registers. Names are unique
per publisher connection, including after a track closes, so each must differ from every name used before; an
attempt that fails uses its name up, and the next asks for the next. Default `${track}-${replacement + 1}`:
`audio-2`, `audio-3`, and so on.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `replacement` | `number` |

#### Returns

`string`

***

### track

```ts
track: string;
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:27](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L27)

The first track's name.

***

### trackProperties?

```ts
trackProperties?: readonly PublishProperty[];
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:36](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L36)

Every track's properties, as `registerTrack` takes them.

***

### writer?

```ts
writer?: FrameWriterOptions<F>;
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:40](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L40)

Every track's frame writer options. Default `{ grouping: 'frame' }`, the mapping for audio.

***

### writeTimeoutMs?

```ts
writeTimeoutMs?: number;
```

Defined in: [relay-sdks/ts/src/replaceable-track.ts:38](https://github.com/caprids/relay-sdks/blob/main/ts/src/replaceable-track.ts#L38)

Every track's write timeout, as `registerTrack` takes it.
