# octoroom v0.1.0 - API Reference

## Modules

- [Octoroom](Octoroom.md): Programmable voice and video rooms for Phoenix apps, carried by Cloudflare
Realtime SFU.
- [Octoroom.Audio](Octoroom.Audio.md): Conversions between room PCM (48 kHz stereo s16le, Opus's own format, 20 ms
frames) and the format a worker asks for. Rates must divide 48 kHz
(8, 12, 16, 24 or 48 kHz) and channels must be 1 or 2.

- [Octoroom.Cloudflare](Octoroom.Cloudflare.md): The Cloudflare Realtime SFU operations Octoroom uses, as a behaviour.
`Octoroom.Cloudflare.HTTP` calls the real API; tests use an in-memory fake.
- [Octoroom.Cloudflare.HTTP](Octoroom.Cloudflare.HTTP.md): `Octoroom.Cloudflare` over Cloudflare's HTTP API. Needs `:app_id` and
`:app_secret` in the config. `:request_fun` (default `&Req.request/1`) is
for tests.
- [Octoroom.Cloudflare.Local](Octoroom.Cloudflare.Local.md): An in-process, localhost-only `Octoroom.Cloudflare` SFU backed by `ex_webrtc`.
- [Octoroom.Janitor](Octoroom.Janitor.md): Deletes room records, and what the room's workers saved, whose room
hasn't run for longer than `:room_ttl_ms`:
past that, no resume token can bring the room back, so the record would
only make a new room with the same id think it's recovering.
- [Octoroom.Outlet](Octoroom.Outlet.md): One worker output track. Paces audio to real time and sends it, Opus
encoded, through the worker's peer connection: Cloudflare forwards
whatever it is sent, so anything sent early would still play after a
barge-in.
- [Octoroom.Participant](Octoroom.Participant.md): A connected client: its id, the metadata its room's `join/2` returned, and
the tracks it publishes.
- [Octoroom.Phoenix.Channel](Octoroom.Phoenix.Channel.md): A Phoenix channel that connects one browser to a room.
- [Octoroom.Reconciler](Octoroom.Reconciler.md): Diffs desired against actual room state and returns the operations that
turn one into the other. Pure.
- [Octoroom.Room](Octoroom.Room.md): A room module decides who may join a room and who hears whom.
- [Octoroom.Store](Octoroom.Store.md): Where Octoroom keeps what must outlive a room server or a node restart:
room records and what workers save. A small key-value behaviour, so it can
sit on ETS, Postgres or Redis.
- [Octoroom.Store.ETS](Octoroom.Store.ETS.md): The default `Octoroom.Store`: an ETS table, snapshotted to a file so it
survives a node restarting in place. Enough for one node; a deploy that
replaces the machine needs a store outside it.
- [Octoroom.Telemetry](Octoroom.Telemetry.md): The `:telemetry` events Octoroom emits. Measurements are maps of numbers;
metadata always includes `room_id` where there is a room.
- [Octoroom.Track](Octoroom.Track.md): A subscription to a room-scoped track, such as `"alice/mic"` or
`"alice/camera"`.
- [Octoroom.Worker](Octoroom.Worker.md): A server-side participant: a process that hears input tracks and plays
output tracks as PCM, with no WebRTC in sight.
- [Octoroom.Worker.Context](Octoroom.Worker.Context.md): What a worker knows when it starts: its room, its id, its input and output
track names, its data outputs, and the room's participants at that
moment. Call
`Octoroom.Room.state/1` for anything newer.

