Plays raw signed 16-bit little-endian PCM arriving on a TCP port through this machine's
speaker, one connection after another — the far end of TuningFork.Sink.Tcp over an
ssh tunnel.
{:ok, listener} = TuningFork.Listener.start_link(port: 5000)Each connection opens the sink afresh and closes it when the connection ends; the next
connection is accepted then. Audio that has arrived faster than it can play — a burst
while the device was opening, a stall on the link — is dropped down to :max_lag_ms,
so what is heard stays that close to what was sent.
Options
:port— the TCP port to listen on;0picks a free one andport/1tells which. Required:ip— the interface to listen on. Default{127, 0, 0, 1}, this machine only:rate,:channels— the PCM format. Default44_100and2:sink— theTuningFork.Sinkto play through, asmoduleor{module, opts}. DefaultTuningFork.Sink.Speaker:max_lag_ms— the most audio kept waiting to play. Default100:name— a registered name. Default: none
Summary
Functions
Returns a specification to start this module under a supervisor.
The port being listened on.
Start listening.
Functions
Returns a specification to start this module under a supervisor.
See Supervisor.
@spec port(GenServer.server()) :: :inet.port_number()
The port being listened on.
@spec start_link(keyword()) :: GenServer.on_start()
Start listening.