# Audio player

> Plays an attached WAV asset as one stream for loops, beds and backing tracks, following the transport or running free.

Source: https://docs.tune.toys/nodes/std.player/

Plays one recording into the patch: a drum loop, an ambient bed or a backing track. Attach a WAV file to the node and it plays when the Toy plays.

## What it does

The player reads the attached file between Start and End at the chosen Rate. In Loop it repeats that region, crossfading at the seam; in Once it plays the region and stops. With Transport sync it plays only while the transport rolls and starts again from the top whenever the transport starts, so a take and its offline render hear exactly the same audio.

Starting, stopping and restarting fade over Fade so nothing clicks. Stopping returns to the start. The engine decodes and resamples the file once, when the Toy is prepared; until a file is attached the node is silent, and the inspector says why when the file is missing or cannot be played.

It plays WAV files only (16, 24 or 32-bit integer or 32 and 64-bit float, one to eight channels, 8 to 192 kHz). Lanes map as on the [Sampler](https://docs.tune.toys/nodes/std.sampler/).

## When to use it

Use it for any recording that plays as it is, not from the keys: loops, beds, backing tracks, sound effects started by a clock or a button. To play a recording across a keyboard, use the [Sampler](https://docs.tune.toys/nodes/std.sampler/). Video stays on the [Media player](https://docs.tune.toys/nodes/media.player/).

## Ports

<!-- ports:start -->

| Port    | Direction | Signal | Lanes                   |
| ------- | --------- | ------ | ----------------------- |
| `audio` | Output    | Audio  | Inferred from the cable |

<!-- ports:end -->

## Parameters

<!-- parameters:start -->

| Parameter | Label   | Range     | Default | Unit | Scale  | Notes                                                                                                                                    |
| --------- | ------- | --------- | ------- | ---- | ------ | ---------------------------------------------------------------------------------------------------------------------------------------- |
| `playing` | Playing | 0 to 1    | 1       |      | linear | Plays or stops. Stopping fades out and returns to the start; a cable into @playing starts and stops it. Choices: 0 Stopped, 1 Playing.   |
| `restart` | Restart | 0 to 1    | 0       |      | linear | A rise through 0.5, such as a clock pulse, jumps back to the start with a short crossfade.                                               |
| `loop`    | Loop    | 0 to 1    | 1       |      | linear | Once stops at the region's end; Loop repeats the region with a crossfade at the seam. Choices: 0 Once, 1 Loop.                           |
| `start`   | Start   | 0 to 1    | 0       |      | linear | Start of the region, as a fraction of the file.                                                                                          |
| `end`     | End     | 0 to 1    | 1       |      | linear | End of the region, as a fraction of the file. At or before Start the player is silent.                                                   |
| `rate`    | Rate    | -4 to 4   | 1       | ×    | linear | Speed and pitch together. 1 plays as recorded; negative values play backwards from the end.                                              |
| `gain`    | Gain    | -60 to 12 | 0       | dB   | linear | Output level. -60 dB is silent.                                                                                                          |
| `sync`    | Sync    | 0 to 1    | 1       |      | linear | Free plays whenever Playing is on. Transport also needs the transport rolling and restarts when it starts. Choices: 0 Free, 1 Transport. |
| `fade_ms` | Fade    | 0 to 100  | 5       | ms   | linear | De-click time for starts, stops, restarts and loop seams.                                                                                |

<!-- parameters:end -->

<!-- data:start -->

- `asset`: asset.

<!-- data:end -->

### Playing (`playing`)

Plays or stops. Stopping fades out and returns to the start. A control cable into `@playing` starts and stops it from the patch.

### Restart (`restart`)

A rise through 0.5 jumps back to the start with a crossfade. Cable a clock pulse (`ctl.clock`) into `@restart` to re-sync a loop every bar, or bind it to a Frame trigger.

### Loop (`loop`), Start (`start`) and End (`end`)

The region, as fractions of the file, and whether it repeats. In Loop the seam crossfades with the material just before Start; where the file has none (Start at 0) the seam fades out and back in instead. In Once the region plays to its end and the player stays silent until the next restart or start.

### Rate (`rate`)

Speed and pitch together: 1 plays as recorded, 2 an octave up at double speed, and negative values play backwards from End.

### Gain (`gain`)

Output level, from −60 dB (silent) to +12 dB.

### Sync (`sync`)

Free plays whenever Playing is on. Transport also needs the transport rolling and restarts each time it starts, which keeps loops aligned with the bar and replays deterministic.

### Fade (`fade_ms`)

The de-click time, up to 100 ms, for starts, stops, restarts and loop seams. Set it to 0 for a loop that is already seamless.

## Tips

- Trim a loop to whole bars so it stays on the beat at Rate 1.
- A loop recorded at another tempo drifts against the transport; Rate changes its pitch too, since the player does not time-stretch.
- Put a [Gain](https://docs.tune.toys/nodes/std.gain/) or a compressor after a backing track to sit it under live parts.

## See also

[Sampler](https://docs.tune.toys/nodes/std.sampler/), [Media player](https://docs.tune.toys/nodes/media.player/), [Gain](https://docs.tune.toys/nodes/std.gain/), [Cables](https://docs.tune.toys/concepts/cables/).
