TuningFork.Sink.Pulse (TuningFork v0.1.0)

Copy Markdown View Source

A sink that plays through a PulseAudio or PipeWire server by piping PCM into pacat.

{:ok, _stage} = TuningFork.Stage.start_link(sink: TuningFork.Sink.Pulse, sink_opts: [server: "tcp:127.0.0.1:24713"])

The server is named the way PULSE_SERVER is: tcp:host:port, or a socket path. A server reached through an ssh reverse tunnel is tcp:127.0.0.1:<forwarded port>. The program's own blocking write is the pacing: a write returns once the server has taken the bytes.

Options

  • :server — the PULSE_SERVER value. Required
  • :latency_ms — the buffer asked of the server. Default 40
  • :command — the player program. Default: pacat on PATH
  • :args — its arguments. Default: player_args/1 for the stage's rate and channels
  • :rate, :channels — filled in by the stage

Summary

Functions

The arguments that make pacat take raw 16-bit little-endian PCM at the given rate and channel count.

Types

t()

@type t() :: port()

Functions

player_args(opts)

@spec player_args(keyword()) :: [String.t()]

The arguments that make pacat take raw 16-bit little-endian PCM at the given rate and channel count.