# AudioPlayerInput

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

Defined in: [audio-player.ts:189](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L189)

One input of an [AudioPlayer](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/interfaces/audioplayer/): one track, usually one speaker.

## Properties

### gain

```ts
gain: number;
```

Defined in: [audio-player.ts:201](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L201)

The input's gain.

***

### joinPhases

```ts
readonly joinPhases: Readonly<AudioInputJoinPhases>;
```

Defined in: [audio-player.ts:222](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L222)

When each step of this input's start happened, for measuring a join.

***

### playbackRate

```ts
playbackRate: number;
```

Defined in: [audio-player.ts:207](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L207)

Held audio played per output frame, from the next render quantum: above 1 sheds latency, below 1 gains it, and
pitch shifts with it (no time-stretching). From 0.5 to 2. Held audio, the jitter target, trims and the hard bound
stay measured in held audio, and reports carry the timestamp at the fractional read position.

***

### playoutLeadUs

```ts
readonly playoutLeadUs: number;
```

Defined in: [audio-player.ts:216](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L216)

How far ahead of the playout clock's position the input wants frames, in microseconds: the output delay (the
context's `baseLatency` and `outputLatency` and the player's `outputDelayUs`) plus the jitter target now. A frame
sequencer under timestamp playout releases held frames this far ahead (`timestampPlayout: { leadUs: () =>
input.playoutLeadUs }`), so the input holds about its target of audio and nothing is trimmed.

***

### removed

```ts
readonly removed: boolean;
```

Defined in: [audio-player.ts:220](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L220)

Whether `remove()` or the player's `close()` was called.

***

### stats

```ts
readonly stats: Readonly<AudioInputStats>;
```

Defined in: [audio-player.ts:209](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L209)

Counters, refreshed with each report from the worklet.

## Methods

### cut()

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

Defined in: [audio-player.ts:199](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L199)

Drop audio already received in a timeline range, held or still decoding, as at a talker's interruption. No range
drops everything held, as a flush does.

#### Parameters

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

#### Returns

`void`

***

### push()

```ts
push(frame): void;
```

Defined in: [audio-player.ts:194](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L194)

Decode and buffer a frame, in decode order. A frame reader's `onFrame` can be this. A `resync` or `restart`
discontinuity also flushes what is held: it belongs to the replaced timeline.

#### Parameters

| Parameter | Type |
| ------ | ------ |
| `frame` | [`AudioPlayerFrame`](https://www.caprid.com/docs/reference/typescript/caprid/moq-media/type-aliases/audioplayerframe/) |

#### Returns

`void`

***

### remove()

```ts
remove(): void;
```

Defined in: [audio-player.ts:218](https://github.com/caprids/relay-sdks/blob/main/ts/packages/moq-media/src/audio-player.ts#L218)

Stop: the decoder closes, the worklet stops, and the clock goes to wall pacing.

#### Returns

`void`
