Welcome
playd is a tiny cross-platform audio player developed by University Radio York. It uses C++14 and libraries like libsndfile, libmpg123, SDL2, and libuv to decode audio, play it to any output device, and take commands via a simple, line-based TCP protocol.
The latest release at time of writing is v0.3.0 Archway; the documentation hosted here refers to it.
Features
playd doesn't have many features, as it's intended to be a minimal player core for use in bigger things. Here are some features it does have:
- Plays any file format supported by libsox;
- Selectable output device at launch-time;
- Play/Stop/Seek/Eject/Load commands;
- Text-based TCP/IP interface;
- Cross-platform: we've built it on Windows, FreeBSD, OS X, and some GNU/Linux distributions.
Example
Launching playd:
$ playd
usage: playd ID [HOST] [PORT]
where ID is one of the following numbers:
0: Speakers (Sound Blaster Z)
1: SPDIF-Out (Sound Blaster Z)
2: Realtek Digital Output(Optical) (Realtek High Definition Audio)
3: Realtek Digital Output (Realtek High Definition Audio)
4: ASUS VE278-4 (NVIDIA High Definition Audio)
default HOST: 0.0.0.0
default PORT: 1350
$ playd 0
Connecting to playd through a TCP/IP client (commands in lowercase are sent by the client, commands in capitals from the server):
! OHAI 1 bifrost-0.3.0 playd-v0.2.0-278-g2d9f096
! IAMA player/file
! EJECT
! ACK OK success
! FLOAD '/path/to/file.mp3'
! POS 0
0 ACK OK success
1 play
! PLAY
1 ACK OK success
! POS 1021678
! POS 2043356
! POS 3018594
2 stop
! STOP
2 ACK OK success
Legal
playd itself is licensed under the MIT licence. However, it includes, and uses, code under other licences, including the LGPL. The licences of software included as part of playd are available as part of the source distribution.
Installation
You can find the latest code, and instructions on how to use it, at playd's GitHub page.
Usage
See the man page for usage instructions.
Resources
playd
- Man page - provides a concise description of how to run playd.
- Documentation - contains the READMEs included in the playd distribution, as well as auto-generated source code documentation.
- GitHub - source code for playd, as well as an issue tracker and resources for contributing.
- BAPS3 Spec - a formal(ish) document on the playout system for which playd was developed.
Similar projects
playd is not the first attempt at a minimalist audio player. Here are resources on similar projects which may better suit your needs.
- Music Player Daemon has a similar, minimalist philosophy, but a wider scope.
- aplay (and similar programs) are examples of lightweight audio players, but lack playd's network interface.
Further reading
Articles that are relevant, but not directly related, to playd.
- A Plea for Lean Software (Wirth, 1995) - dated, but an early article about the perils of bloated software.
- The Art of Unix Programming (Raymond, 2003) - a very good resource on the UNIX philosophy and its influences on software development.