One connected snapclient. Owns the TCP socket, speaks the snapcast protocol, and writes the audio chunks the stream hands it.
On Hello it replies with ServerSettings and registers with Snapcast.Server. The
server then assigns the active stream and sends that stream's CodecHeader exactly
once (PCM via set_format/3, FLAC via the stream's attach) — the equivalent of
snapserver's send(stream->getHeader()). A connecting client therefore receives one
codec header for the stream it will play (or none while idle), not a default header
followed by the real one. It answers Time requests for clock sync and tracks the
client's volume/mute from ClientInfo.
Summary
Functions
Start reading from the socket (after the acceptor transfers ownership).
Returns a specification to start this module under a supervisor.
Write a pre-built codec header payload (e.g. the FLAC stream header) to the client.
Hand a framed message to this session to write to its socket.
Re-send ServerSettings (format-scaled bufferMs) for the next stream, plus — for the
:pcm transport — the matching PCM CodecHeader. The :flac transport sends its
CodecHeader from the stream via send_codec_header/2 once it has been parsed.
Set this client's playback volume (0-100) via a fresh ServerSettings.
Functions
Start reading from the socket (after the acceptor transfers ownership).
Returns a specification to start this module under a supervisor.
See Supervisor.
Write a pre-built codec header payload (e.g. the FLAC stream header) to the client.
Hand a framed message to this session to write to its socket.
Re-send ServerSettings (format-scaled bufferMs) for the next stream, plus — for the
:pcm transport — the matching PCM CodecHeader. The :flac transport sends its
CodecHeader from the stream via send_codec_header/2 once it has been parsed.
Set this client's playback volume (0-100) via a fresh ServerSettings.