Listen to Music in Terminal with Spectrum

Written with C++ and the FTXUI library.


Listen to Music in Terminal with Spectrum

Spectrum is a console-based music player written in C++ and with the FTXUI library, that is, you will have a TUI environment to view graphically the frequency of each part of your song.


Installation

First of all you will need the following dependencies, example for Ubuntu:

sudo apt install build-essential libasound2-dev libavcodec-dev \
      libavfilter-dev libavformat-dev libfftw3-dev libswresample-dev

After that just clone the repository and compile:

git clone https://github.com/v1nns/spectrum.git
cd spectrum
cmake -S . -B build

Once compiled, you can test it without installing by running the command: ./build/src/spectrum, but to install it on your system, run:

sudo cmake --install build

Once installed, you can remove the cloned directory: rm -rf spectrum/


Usage

To open Spectrum just run the command:

spectrum
  • Navigate using the directional arrows in the Box on the left side of the screen to choose and play the song with [ENTER];
  • Also use the mouse (if you want) to click on options such as: equalizer, play, stop, advance or rewind the music time and among others;
  • To exit press q.

Screenshots

Spectrum Play

Click on the image to view it in a higher resolution


Spectrum Equalizer

Click on the image to view it in a higher resolution


We made a video about the FTXUI library which can be seen at the address below:

https://terminalroot.com/create-graphical-programs-in-terminal-with-ftxui/

For more information about Spectrum visit the repository on GitHub.


cpp cppdaily tui terminal


Share


YouTube channel

Subscribe


Marcos Oliveira

Marcos Oliveira

Software developer
https://github.com/terroo

Related articles