Shuffling M3U music player with a TUI, tag titles, and ReplayGain support
Find a file
Repository files (latest commit first)
Filename Latest commit message Latest commit date
Wayne Powers c52c112441 mplay: shuffling M3U player with TUI, tag titles, and ReplayGain
Plays an M3U playlist (default Stuff.m3u) shuffled and looping, with a
ratatui interface for pause/skip/volume. Track titles come from embedded
tags via lofty, and REPLAYGAIN_TRACK_GAIN/_PEAK tags adjust playback
volume per track.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
2026-07-02 15:44:19 -04:00
src mplay: shuffling M3U player with TUI, tag titles, and ReplayGain 2026-07-02 15:44:19 -04:00
.gitignore mplay: shuffling M3U player with TUI, tag titles, and ReplayGain 2026-07-02 15:44:19 -04:00
Cargo.lock mplay: shuffling M3U player with TUI, tag titles, and ReplayGain 2026-07-02 15:44:19 -04:00
Cargo.toml mplay: shuffling M3U player with TUI, tag titles, and ReplayGain 2026-07-02 15:44:19 -04:00
README.md mplay: shuffling M3U player with TUI, tag titles, and ReplayGain 2026-07-02 15:44:19 -04:00

mplay

A tiny terminal music player: point it at an .m3u playlist, and it shuffles the tracks and plays them back-to-back with a TUI showing what's on.

Usage

mplay [playlist.m3u]

With no argument, Stuff.m3u in the current directory is used.

The playlist is shuffled on startup, and reshuffled automatically every time it wraps around, so playback loops forever in a fresh order.

Keys

Key Action
space Pause / resume
n / Next track
p / Previous track
r Reshuffle and restart
/ Volume up / down
q / Esc Quit

Playlist format

Plain and extended M3U are both supported:

  • Track titles come from the file's embedded tags (ID3v2, Vorbis comments, MP4 atoms) as Artist - Title when available, falling back to the #EXTINF:<secs>,<title> line, then the filename.
  • Relative paths are resolved against the playlist's directory.
  • Comment lines (#...) and network stream URLs are skipped.

Supported audio formats (via symphonia): MP3, FLAC, OGG/Vorbis, WAV, M4A/AAC.

ReplayGain

If a track carries ReplayGain tags, the volume is adjusted automatically: REPLAYGAIN_TRACK_GAIN is preferred, falling back to REPLAYGAIN_ALBUM_GAIN, and REPLAYGAIN_TRACK_PEAK caps the boost to avoid clipping. The applied gain is shown in the now-playing panel (e.g. RG -6.5 dB), and the volume keys adjust your listening level on top of it. To edit the playlist, see the companion m3uedit tool.

Building

cargo build --release

Binary lands at target/release/mplay.exe.

Note (Windows GNU toolchain): some dependencies use raw-dylib linking, which requires a full mingw-w64 dlltool/as on PATH — the WinLibs distribution (winget install BrechtSanders.WinLibs.POSIX.UCRT) provides them.