AirPlay.V2.GroupPlayer (AirPlay v0.4.1)

Copy Markdown View Source

Minimal AirPlay 2 multi-room group player.

This mirrors the working airplay2-rs group model:

  • connect and setup every receiver independently
  • use the first receiver as the primary PTP/BMCA clock source
  • send SETPEERS to all receivers
  • decode audio once
  • share one RTP sequence/timestamp timeline across all receivers
  • encrypt each audio packet with the receiver-specific stream key

Summary

Functions

Play a local or HTTP audio source to an AirPlay 2 receiver group.

Set volume on a running AP2 group player process.

Ask a running AP2 group player process to stop.

Functions

play_file(receivers, path, opts \\ [])

@spec play_file([map()], String.t(), keyword()) :: {:ok, map()} | {:error, term()}

Play a local or HTTP audio source to an AirPlay 2 receiver group.

Receivers are maps with at least :host or "host", and optional :port / "port".

set_volume(pid, volume)

@spec set_volume(pid(), number()) :: :ok

Set volume on a running AP2 group player process.

stop(pid)

@spec stop(pid()) :: :ok

Ask a running AP2 group player process to stop.