# `TuningFork.Stage.Clip`
[🔗](https://github.com/jaman/tuning_fork/blob/v0.1.12/tuning_fork/lib/tuning_fork/stage/clip.ex#L1)

Mono PCM a stage sounds under a key: read a chunk at a time, and faded to silence when
let go.

    clip = Clip.new(mono)
    {chunk, clip} = Clip.take(clip, 512)
    clip = Clip.release(clip, 441)

# `t`

```elixir
@type t() :: %TuningFork.Stage.Clip{
  fade: nil | {float(), pos_integer(), non_neg_integer()},
  pcm: binary()
}
```

# `new`

```elixir
@spec new(binary()) :: t()
```

A clip of signed 16-bit little-endian mono `pcm`.

# `release`

```elixir
@spec release(t(), pos_integer()) :: t()
```

Let the clip fall silent over `frames` frames from the level it has reached; a clip
already falling starts the new fall from where it is.

# `take`

```elixir
@spec take(t(), pos_integer()) :: {binary(), t() | :done}
```

The next `frames` frames and the clip after them, or `:done` in place of the clip once
its PCM or its fade has run out. Short at the end.

    iex> {chunk, :done} = TuningFork.Stage.Clip.take(TuningFork.Stage.Clip.new(<<1, 0, 2, 0>>), 8)
    iex> chunk
    <<1, 0, 2, 0>>

---

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