# `Octoroom.Agent.Audio.Mixer`
[🔗](https://github.com/samrat/octoroom/blob/v0.1.0/agents/lib/octoroom/agent/audio/mixer.ex#L1)

Mixes several inputs of s16le mono PCM into one stream, a chunk at a time,
for a model that has one audio input (Gemini Live).

Inputs arrive in real time but not in step, so the caller pulls a chunk
on its own clock (`pull/1` every `chunk_ms`) and each input gives what it
has. An input starts being mixed once it has two chunks buffered, which
rides out a frame arriving just after the pull instead of mixing in a gap
of silence. It stops when it runs dry, and buffers at most `max_ms`
(the oldest is dropped), so a burst doesn't add latency for good.

# `t`

```elixir
@type t() :: %Octoroom.Agent.Audio.Mixer{chunk: term(), inputs: term(), max: term()}
```

# `drop`

# `new`

Options: `:rate` (default 16 kHz), `:chunk_ms` (20), `:max_ms` (200).

# `pull`

One chunk of the inputs mixed, or nil when none is being mixed.

# `push`

---

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