FOSS Music Player - Mpc,mpc and Rmpclqip

FOSS Music Player - Mpc,mpc and Rmpc

Music Player Daemon

Music Player Daemon (MPD) is an audio player that has a server-client architecture. MPD plays audio files, organizes playlists and maintains a music database, all while using very few resources. In order to interface with it, a separate client is needed.

from Arch Wiki

Setup MPD

安装后,可以通过如下命令创建配置目录并启动/关闭mpd服务。这里个人按照 XDG Base Directory Specification,将mpd配置文件放在 ~/.config/mpd/ 目录下

SHELL
# The default config dir is ~/.mpd# I prefer use $XDG_CONFIG_PATH to store mpd config;   mkdir ~/.config/mpdmkdir ~/.config/mpd/playlists# Start/Kill Mpdmpd ~/.config/mpd/mpd.confpkill mpd

mpd配置[1]里可以指定多个 audio_output,添加 fifo 输出可以配合 cava 做音乐可视化

CONF
~/.config/mpd/mpd.conf
music_directory    "~/Music/CloudMusic"bind_to_address     "127.0.0.1"port               "6600"audio_output { type "osx" name "CoreAudio" mixer_type "software"}audio_output { type "fifo" name "my_fifo" path "/tmp/mpd.fifo" format "44100:16:2" auto_resample "no" use_mmap "yes"}

MPC

mpc(Music Player Client)[2]提供了一个minimalist CLI to MPD,可以够满足基本的播放需求;例如使用如下命令切换歌曲、查看当前播放、根据 ID3Tags[3] 搜索歌曲等

SHELL
MPC Examples
# 切换到下一首$ mpc nextRadiohead - Pyramid Song[playing] #7/50   0:00/4:49 (0%)volume: 96%   repeat: off   random: off   single: off   consume: off# 查看当前播放的音乐$ mpc current Radiohead - Pyramid Song# 使用ID3Tags查询音乐文件$ mpc search artist radiohead摇滚/Radiohead - Pyramid Song.mp3摇滚/Radiohead - How Can You Be Sure?.mp3摇滚/Radiohead - Karma Police.mp3摇滚/Radiohead - Let Down.mp3摇滚/Radiohead - No Surprises.mp3摇滚/Radiohead - I Promise.mp3摇滚/Radiohead - Creep.mp3摇滚/Radiohead - Fake Plastic Trees.mp3摇滚/Radiohead - Black Star.mp3

可以利用mpc提供的接口实现一些脚本,或集成到SketchyBar,i3 status等状态栏中

mpd启动后,播放队列默认为空,可以执行下述命令将所有音乐文件添加到队列中

SHELL
mpc clearmpc listall | mpc add

RMPC

如果想要一个更丰富的TUI体验,可以下载RMPC (Rust Music Player Client)[4],它是用Rust编写的MPD客户端,功能丰富且高度可配置

Rmpc Features

  • Album cover art display if your terminal supports either of Kitty, Sixel, Iterm2 protocols, or via ueberzuggpp
  • Cava integration for music visualisation
  • Support for synchronized lyrics
  • Ability to play music from YouTube
  • Configurable (T) UI
    • Configure what information (if any!) is displayed in the header
    • Configure what columns are displayed on the queue pane
    • Completely customize what tabs are rendered and mix and match their content
    • Create any color theme you want
    • Every keybind can be changed, vim-like by default
  • Ranger/LF-like three-column browser through your music library
  • Basic playlist management
  • Support scripting through basic CLI mode and script hooks
  • Remote control - Send commands to running rmpc instances (useful for window manager integration).

个人配置后的rmpc界面预览如下:

rmpc_preview

这里特别说一下rmpc的歌词和可视化功能

根据 Lyrics fetching from the song file · Issue #287 · mierak/rmpc,rmpc目前还不支持从mp3/flac文件中读取嵌入的歌词标签,要想显示歌词需要额外准备 lrc 文件。

现在工具很成熟,可以使用音乐标签Android版 等软件轻易完成批处理

rmpc使用RON (Rusty Object Notation) 作为配置语言,上手需要一定的学习成本,这里就不展开介绍个人的配置细节了,可以参考我的配置仓库[5]


  1. Check mpd.conf — Music Player Daemon 0.25~git documentation for detailed documentation. ↩︎

  2. mpc - Music Player Daemon ↩︎

  3. ID3 - 维基百科,自由的百科全书 ↩︎

  4. Rmpc configs dotfiles/tui_cli/rmpc at main ↩︎

  5. Mpd Configs dotfiles/tui_cli/mpd at main; Rmpc Configs dotfiles/tui_cli/rmpc at main) ↩︎

FOSS Music Player - Mpc,mpc and Rmpc

https://vluv.space/music-rmpc/

作者

GnixAij

发布于

2025-10-18

更新于

2025-10-19

许可协议

评论