Skip to content

derhuerst/friendly-audio-streaming-protocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Friendly Audio Streaming Protocol (FASP)

A simple and open protocol for streaming audio in local networks.

Sort of like AirPlay and DLNA, but

  • code & spec are openly available
  • no DRM
  • un-overengineered: XML JSON, reverse HTTP WebSockets
  • flexible: any client can control playback & play new media

If you want to try it out, head over to Getting started.

CC-licensed chat on gitter

How it works

A FASP receiver is a WebSocket server. Any number of clients can connect to it and send the following commands, encoded as JSON:

  • ["play", "http://example.org/some-url"]
  • ["queue", "http://example.org/some-url"]
  • ["next"]
  • ["previous"]
  • ["remove", 2]
  • ["stop"]
  • ["resume"]
  • ["pause"]
  • ["seek", 123, false, false] (relative, in seconds)
  • ["seek", 123, true, false] (absolute, in seconds)
  • ["seek", 123, true, true] (absolute, in percent)
  • ["seek", 123, false, true] (relative, in percent)
  • ["set-volume", 70]
  • ["get-props"]

The receiver may send the following commands to the client, encoded as JSON:

  • ["prop", {"filename": …, "title": …, "album": …, "artist": …, "length": …, "progress": …, "volume": …, "playing": …}]
  • ["prop", "filename", "some-file.ogg"]
  • ["prop", "path", "path/to/some-file.ogg"]
  • ["prop", "duration", 219.5]
  • ["prop", "percent-pos", 2,477]
  • ["prop", "time-pos", 54.5]
  • ["prop", "pause", false]
  • ["prop", "volume", 70]
  • ["prop", "metadata", {title, album, artist, album_artist, track, disc}]
  • ["prop", "artwork", "https://example.org/path/to/artwork.jpg"]
  • ["prop", "queue", ["some-file.ogg", "another-file.mp3"]]

A receiver announces itself via mDNS, with the following properties:

  • service type: _fasp._tcp.
  • name: a url-safe, ASCII string
  • id: a random hex ID, 16 characters
  • version: the version of the protocol, 2 currently
  • hostname
  • port

Existing implementations

Libraries