# findReplacementTrack

URL: https://www.caprid.com/docs/reference/typescript/caprid/moq-media/functions/findreplacementtrack/

```ts
function findReplacementTrack(current, tracks): 
  | MsfCatalogTrack
  | undefined;
```

Defined in: [parse-catalog.ts:233](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/parse-catalog.ts#L233)

The track in a newer catalog that replaces `current`, a track of an older one: a publisher that replaces a track
lists a new name in its place (msf-01 §5.3: a changed track is a new Namespace|Name tuple), as a voice agent does to
interrupt its own reply. `undefined` while the catalog still lists `current`'s namespace and name; otherwise the
first track listed with `current`'s namespace, role and render group, or `undefined` when there is none (the track
was removed, not replaced).

## Parameters

| Parameter | Type |
| ------ | ------ |
| `current` | [`MsfCatalogTrack`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/msfcatalogtrack/) |
| `tracks` | readonly [`MsfCatalogTrack`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/msfcatalogtrack/)[] |

## Returns

  \| [`MsfCatalogTrack`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/msfcatalogtrack/)
  \| `undefined`
