2
7
Fork
You've already forked amused
1
minimalistic music player https://projects.omarpolo.com/amused.html
  • C 91.7%
  • Roff 3%
  • Perl 2%
  • Makefile 2%
  • C++ 1.2%
  • Other 0.1%
2026年05月03日 16:53:03 +00:00
compat compat: improve SHA1*() compat 2025年12月27日 12:32:21 +00:00
contrib contrib/README: mention the other scripts as well 2026年05月03日 14:39:04 +00:00
mpris2 man pages: fix spelling of TMPDIR 2025年12月27日 13:35:20 +00:00
songmeta fixed make dist 2024年05月26日 16:59:22 +00:00
web man pages: fix spelling of TMPDIR 2025年12月27日 13:35:20 +00:00
.gitignore add mpris2 support 2024年07月28日 14:17:23 +00:00
amused.1 report some info about the current track 2026年01月11日 16:05:47 +00:00
amused.c report some info about the current track 2026年01月11日 16:05:47 +00:00
amused.h report some info about the current track 2026年01月11日 16:05:47 +00:00
audio.h move audio functions to audio.h 2024年05月08日 17:42:03 +00:00
audio_alsa.c expand compats.c in several files 2024年05月09日 13:47:54 +00:00
audio_ao.c ao, oss: fix timing 2024年09月01日 20:20:00 +00:00
audio_oboe.cpp expand compats.c in several files 2024年05月09日 13:47:54 +00:00
audio_oss.c ao, oss: fix timing 2024年09月01日 20:20:00 +00:00
audio_sndio.c expand compats.c in several files 2024年05月09日 13:47:54 +00:00
CHANGES CHANGES for 0.19 2025年05月17日 14:25:46 +00:00
configure copyright ++ 2025年12月27日 13:25:09 +00:00
configure.local.example fix my email address 2023年05月02日 18:17:37 +00:00
control.c report some info about the current track 2026年01月11日 16:05:47 +00:00
control.h remove unused control_imsg_relay 2024年01月21日 12:04:31 +00:00
ctl.c report some info about the current track 2026年01月11日 16:05:47 +00:00
ev.c expand compats.c in several files 2024年05月09日 13:47:54 +00:00
ev.h bring in newer ev and bufio from telescope 2024年04月14日 08:34:50 +00:00
LICENSE initial commit 2022年02月16日 18:28:23 +00:00
log.c expand compats.c in several files 2024年05月09日 13:47:54 +00:00
log.h initial commit 2022年02月16日 18:28:23 +00:00
Makefile add support for WAV files 2026年05月02日 12:12:38 +00:00
player.c add support for WAV files 2026年05月02日 12:12:38 +00:00
player.h add support for WAV files 2026年05月02日 12:12:38 +00:00
player_123.c introduce AMUSED_BUFSIZ 2025年05月03日 15:27:42 +00:00
player_flac.c copyright ++ 2025年12月27日 13:25:09 +00:00
player_oggvorbis.c introduce AMUSED_BUFSIZ 2025年05月03日 15:27:42 +00:00
player_opus.c introduce AMUSED_BUFSIZ 2025年05月03日 15:27:42 +00:00
player_wav.c wav: guard seek out of data section 2026年05月03日 16:53:03 +00:00
playlist.c report some info about the current track 2026年01月11日 16:05:47 +00:00
playlist.h report some info about the current track 2026年01月11日 16:05:47 +00:00
README.md mention amused-mpris2 in the README 2024年09月22日 20:32:59 +00:00
tests.c compat: improve SHA1*() compat 2025年12月27日 12:32:21 +00:00
xmalloc.c expand compats.c in several files 2024年05月09日 13:47:54 +00:00
xmalloc.h initial commit 2022年02月16日 18:28:23 +00:00

amused

amused is a music player. It doesn't have any amazing features built-in, on the contrary: it's quite minimal (a fancy word to say that does very little.) It composes well, or aims to do so, with other tools though.

The main feature is that audio decoding runs in a sandboxed process under pledge("stdio recvfd audio") (on OpenBSD at least.)

It's available on the OpenBSD port tree starting from 7.1

Building

The dependencies are:

  • flac
  • libmpg123
  • libvorbis
  • opusfile
  • libsndio or libasound (ALSA) or libao
  • libmd (optional; needed for amused-web on linux and Mac)

Then, to build:

$ ./configure
$ make
# make install # eventually

To include the metadata extractor utility, songmeta, use:

$ ./configure --with-songmeta

To include the DBus control interface for amused for MPRIS2 support, use:

$ ./configure --with-mpris2

amused-mpris2 requires glib2.

To disable amused-web:

$ ./configure --without-web

The build can be customized by passing arguments to the configure script or by using a configure.local file; see ./configure -h and configure.local.example for more information.

For each library the configure script first tries to see if they're available without any extra flags, then tries again with some hard-coded flags (e.g. -lFLAC for flac) and finally resorts to pkg-config if available. pkg-config auto-detection can be disable by passing PKG_CONFIG=false (or the empty string)

For Linux users with libbsd installed, the configure script can be instructed to use libbsd exclusively as follows:

$ CFLAGS="$(pkg-config --cflags libbsd-overlay)" \
	./configure LDFLAGS="$(pkg-config --libs libbsd-overlay)"

To force the use of one specific audio backend and not simply the first one found, pass --backend as:

$ ./configure --backend=alsa # or sndio, or ao

Usage

The fine man page has all nitty gritty details, but the TL;DR is

  • enqueue music with amused add files... or amused load <playlist
  • control the playback with amused play|pause|toggle|stop
  • check the status with amused status and the current playlist with amused show

amused tries to be usable in composition with other more familiar tools instead of providing everything itself. For instance, there isn't a command to remove an item from the playlist, or sort it; instead, standard UNIX tools can be used:

$ amused show | grep -vi kobayashi | amused load
$ amused show | sort -R | amused load
$ amused show | sort | uniq | amused load

It also doesn't provide any means to manage a music collection. It plays nice with find(1) however:

$ find . | amused load

Non-music files found in the playlist are automatically skipped and removed, so there's no harm in loading everything under a certain directory.

amused-web is a simple web interface to control the player. It opens an HTTP server on localhost:

$ amused-web

I wrote a bit more about the background of amused in a blog post.

Building on Android (termux) -- Experimental

amused can be built on android using the oboe backend, although this has only been tested so far under termux. First, oboe needs to be built locally. Then build amused with:

$ ./configure BACKEND=oboe \
	CXXFLAGS="-I /path/to/oboe/include" \
	LDADD="/path/to/liboboe.a"
[...]
$ make

tip: use termux-setup-storage to access the android storage in ~/storage.

amused-web works and can be used to control the playback, but as amused doesn't respond to the events (calls, headsets buttons, other apps playing music, etc...) it's not particularly pleasing to use.

contrib/amused-termux-notification shows a persistent notification with the song file name and buttons to control the playback, making slightly more nicer to use it.

License

Amused is free software. All the code is distributed under a BSD-style license or is Public Domain, with the only exception of a part of amused-mpris2 which is under the GPLv2 or later. Since amused-mpris2 is an optional, separate executable, it's the only one with the GPL restrictions.