Music Player TUI written in Rust
Listen to music and podcasts freely as both in freedom and free of charge!
|
Freedom: As time goes by, online service providers control pretty much everything we listen to. Complicated copyright issues make things worse. If my favorite song cannot be found on a website, I'll probably just not listen to them for years.
Free of charge: You can download from YouTube, NetEase, Migu and KuGou for free. No need to register for monthly paid memberships.
As a contributor of GOMU, I met serious problems during development. The main problem is data race condition. So I rewrote the player in rust, and hope to solve the problem.
Below are the audio formats supported by the various backends.
In the case that metadata is not supported, an attempt will still be made to play the file.
| Container | Rusty | MPV | Gstreamer | Metadata |
|---|---|---|---|---|
| MP4 / M4A | Yes | Yes | Yes | Yes |
| MP3 | Yes | Yes | Yes | Yes |
| OGG | Yes | Yes | Yes | Yes |
| FLAC | Yes | Yes | Yes | Yes |
| ADTS | Yes | Yes | Yes | Yes |
| WAV / AIFF | Yes | Yes | Yes | Yes |
| CAF | Yes | Yes | Yes | No |
| MKV / WebM | Yes | Yes | Yes | No |
| Codec | Rusty | MPV | Gstreamer |
|---|---|---|---|
| AAC-LC | Yes | Yes | Yes |
| HE-AAC | No | Yes | Yes |
| MP3 / MP2 / MP1 | Yes | Yes | Yes |
| FLAC | Yes | Yes | Yes |
| WAV | Yes | Yes | Yes |
| VORBIS | Yes | Yes | Yes |
| OPUS | No*1 | Yes | Yes |
| ADPCM | Yes | Yes | Yes |
| PCM | Yes | Yes | Yes |
*1: Opus codec is supported in rusty backend if feature rusty-libopus is enabled.
The minimal Rust version required to build this project is 1.90.0.
Note that using non-default features might increase the MSRV.
| Package name (ubuntu) | Package name (arch) | Required | Build-time-only | Feature | Description | MSRV |
|---|---|---|---|---|---|---|
git |
git |
X | X | version control | ||
clang |
clang |
X | X | General Build tools (and sqlite compile) | ||
protobuf-compiler |
protobuf |
X | X | communication protocol between server and client(tui) | ||
libdbus-1-dev |
dbus |
X | unknown | MPRIS media control | ||
libasound2-dev |
alsa-lib |
X | unknown | ALSA headers | ||
yt-dlp |
yt-dlp |
Download some tracks | ||||
ffmpeg |
ffmpeg |
Post-Processing for yt-dlp |
||||
mpv |
mpv |
mpv |
MPV Backend | |||
gstreamer |
gstreamer |
gst |
Gstreamer Backend | |||
libopus |
libopus |
X | rusty-libopus |
Opus codec support in rusty backend | 1.89.0 |
|
ueberzugpp |
ueberzugpp |
cover-ueberzug |
Ueberzug protocol support | |||
libstdc++6 |
gcc-libs |
rusty-soundtouch |
Soundtouch requires linking to libstdc++ |
All the packages here can be installed via various sources, for ease of install the winget package name is listed.
| Package name (winget) | Alternative Source | Required | Build-time-only | Feature | Description | MSRV |
|---|---|---|---|---|---|---|
Git.Git |
X | X | version control | |||
Microsoft.VisualStudio.BuildTools |
X | X | General Windows (C++) build tools | |||
Google.Protobuf |
X | X | communication protocol between server and client(tui) | |||
yt-dlp |
Download some tracks | |||||
ffmpeg |
Post-Processing for yt-dlp |
|||||
| unknown | mpv |
MPV Backend | ||||
| unknown | gst |
Gstreamer Backend | ||||
| unavailable | libopus official site | X | rusty-libopus |
Opus codec support in rusty backend | 1.89.0 |
|
| see list below | X | rusty-soundtouch |
Soundtouch requires linking to libstdc++ |
rusty-soundtouchCompiling feature rusty-soundtouch on windows requires a bunch extra dependencies that are otherwise not required.
It is recommended to just use the pre-built binaries by Github Actions to avoid installing ~2GB of extra C++ Dependencies and potentially having to mess around with dependencies.
If you actually still wanted to compile this yourself, you will need:
C++ CMake tools for Windows via Microsoft.VisualStudio.BuildTools (or also known as Visual Studio Installer)Microsoft.VisualStudio.BuildTools does not provide a clang.dll / libclang.dll, which the cc crate needs for building C++.
Instead, simply install llvm via winget: winget install llvmThis should be everything and feature rusty-soundtouch should compile without problems.
Default backend: rusty
| Backend | Requirements |
|---|---|
| Symphonia(rusty) | On Linux libasound2-dev is required for building. |
| GStreamer | GStreamer |
| MPV | MPV |
There are extra features for some backends: Note that they are not enabled by default and potentially increase non-rust dependencies.
| Feature | Backend | Description | Extra Dependencies | MSRV |
|---|---|---|---|---|
rusty-soundtouch |
rusty |
Enable soundtouch compilation and use as default speed-modifier |
||
rusty-libopus |
rusty |
Enable libopus support to support opus files |
libopus |
1.89.0 |
To display covers in the terminal itself, feature cover can be enabled.
To only enable specific protocols for cover support, see tui/Cargo.toml#features.
Feature cover-ueberzug will require some ueberzug implementation to be present at runtime.
Configuration files can be found in:
| System | Path |
|---|---|
| Linux | ~/.config/termusic/ |
| Mac | ~/Library/Application Support/termusic/ |
| Windows | %APPDATA%\termusic\ |
Files & Folders:
| Paths | Description |
|---|---|
server.toml |
For server configuration |
tui.toml |
For TUI configuration |
themes/ |
Extra Themes to be selected in the Config Editor |
playlist.log |
The Playlist storing the current playlist/queue |
library2.db |
The Indexed Music library |
data.db |
The Podcast Database |
By default logs can be found in:
| System | Path |
|---|---|
| Linux | /tmp/ |
| Mac | /tmp/(?) |
| Windows | %TMP%\ |
Files:
| Files | Description |
|---|---|
termusic-server.log |
The server logs |
termusic-tui.log |
The TUI logs |
termusic-cover.EXT |
MPRIS cover |
The default log level is WARNING (can be changed via RUST_LOG).
Note that log files are only created on the first log line to be saved.
cargo install termusic termusic-server --lockedcargo binstall termusic termusic-servergit clone https://github.com/tramhao/termusic.git
cd termusic
makeThen install with:
make installBy default, termusic can display album covers in Kitty or iTerm2.
If you need album covers displayed on other terminals, you can enable the sixel protocol or use a ueberzug implementation(x11/xwayland only).
To build all backends
No open issues yet, or sync has not completed.