# `Cauldron2D.Net.Sound`
[🔗](https://github.com/jaman/cauldron/blob/v0.1.3/cauldron_2d_net/lib/cauldron_2d/net/sound.ex#L1)

Plays the PCM a `Cauldron2D.Net.Link.Socket` delivers through this machine's speaker,
in a process of its own so the writes never hold up whoever draws.

    {:ok, sound} = Cauldron2D.Net.Sound.start_link()
    Cauldron2D.Net.Sound.play(sound, chunk)

Options: `:sink`, the `TuningFork.Sink` module (default `TuningFork.Sink.Speaker`);
`:rate` and `:channels` (default 44100 and 2). The sink opens on the first chunk;
`format/3` sets the rate and channels the next chunks come in, reopening it.

# `child_spec`

Returns a specification to start this module under a supervisor.

See `Supervisor`.

# `format`

```elixir
@spec format(GenServer.server(), pos_integer(), 1 | 2) :: :ok
```

The rate and channels the chunks come in from now on.

# `play`

```elixir
@spec play(GenServer.server(), binary()) :: :ok
```

Queue a chunk of signed 16-bit little-endian PCM.

# `start_link`

```elixir
@spec start_link(keyword()) :: GenServer.on_start()
```

Start the player.

---

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