# `TuningFork.Sink`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.11/tuning_fork/lib/tuning_fork/sink.ex#L1)

The behaviour of an output for mixed samples: opened once, written to in chunks, closed.

# `t`

```elixir
@type t() :: term()
```

# `close`

```elixir
@callback close(t()) :: :ok
```

Release the sink.

# `open`

```elixir
@callback open(keyword()) :: {:ok, t()} | {:error, term()}
```

Open the sink with the stage's options, which always include `:rate` (samples per second)
and `:channels` (samples per frame). Returns the state the other callbacks receive.

# `write`

```elixir
@callback write(t(), binary()) :: :ok | {:error, term()}
```

Take one chunk of signed 16-bit little-endian PCM.

Must not block for longer than the audio the chunk represents. Must return
`{:error, reason}` when the destination can no longer take samples; the stage then stops
feeding this sink.

# `configured`

```elixir
@spec configured() :: module()
```

The sink named by the `:tuning_fork, :sink` setting, defaulting to `TuningFork.Sink.Silent`.

---

*Consult [api-reference.md](api-reference.md) for complete listing*
