This is a cache of https://github.com/FedeCarollo/jukebox-cli. It is a snapshot of the page as it appeared on 2025-08-08T20:35:45.823+0200.
GitHub - FedeCarollo/jukebox-cli: Jukebox MP3 CLI player in Rust
Skip to content

FedeCarollo/jukebox-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

13 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽต Jukebox CLI

A beautiful terminal-based music jukebox application built with Rust and Ratatui. Features an animated visual interface with floating musical notes and intuitive controls.

Jukebox CLI Screenshot

โœจ Features

  • ๐ŸŽถ Visual Jukebox Interface: Beautiful background image with animated musical notes
  • ๐Ÿ“ฑ Responsive UI: Adapts to terminal size with scrollable playlist
  • โฏ๏ธ Full Playback Control: Play, pause, resume, skip tracks
  • ๐Ÿ”Š Volume Control: Adjustable volume with visual feedback
  • ๐Ÿ“Š Progress Tracking: Real-time progress bars for song duration and volume
  • ๐ŸŽจ Colorful Interface: Each song has its own color in the playlist

๐Ÿš€ Installation

Prerequisites

  • Rust 1.70+ (install from rustup.rs)
  • Terminal that supports 256 colors and Unicode

Build from Source

git clone https://github.com/FedeCarollo/jukebox-cli.git
cd jukebox-cli
cargo build --release

๐ŸŽฎ Usage

Basic Usage

# Use default music directory (example_music)
cargo run

# Specify custom music directory
cargo run -- /path/to/your/music

# Show help
cargo run -- --help

Controls

Key Action
q Quit application
p / Enter Play/Resume current song
s Pause playback
โ†‘ / โ†“ Navigate playlist
+ / - Adjust volume

๐ŸŽจ Interface Layout

โ”Œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”
โ”‚                             โ”‚   ๐Ÿ“‹ Playlist   โ”‚
โ”‚    ๐ŸŽต Jukebox Display       โ”‚   โ™ช Song 1      โ”‚
โ”‚     (with animated          โ”‚   โ™ซ Song 2      โ”‚
โ”‚      floating notes)        โ”‚   โ™ฌ Song 3      โ”‚
โ”‚                             โ”‚   ...           โ”‚
โ”œโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ฌโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ค                 โ”‚
โ”‚   ๐ŸŽฎ Controls   โ”‚ ๐Ÿ“Š Info   โ”‚                 โ”‚
โ”‚ q-Quit p-Play   โ”‚ โ–“โ–“โ–“โ–‘โ–‘ 60% โ”‚                 โ”‚
โ”‚ โ†‘โ†“-Navigate     โ”‚ ๐Ÿ”Š 75%    โ”‚                 โ”‚
โ””โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”ดโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”˜

๐Ÿ”ง Features in Detail

Visual Interface

  • Jukebox Background: Customizable PNG background that fills the main display area
  • Animated Notes: Musical note sprites that appear randomly during playback
  • Responsive Layout: Automatically adjusts to terminal dimensions

Playlist Management

  • Circular Navigation: Navigate seamlessly from last to first song and vice versa
  • Auto-advance: Automatically plays next song when current song ends
  • Visual Indicators: Selected song is underlined, playing song is highlighted

Audio Features

  • Format Support: MP3 files via Symphonia decoder
  • Volume Control: 0-100% volume with emoji indicators (๐Ÿ”‡๐Ÿ”ˆ๐Ÿ”‰๐Ÿ”Š)
  • Progress Tracking: Real-time display of current position and total duration

Performance

  • Efficient Rendering: Background caching and optimized note generation
  • Responsive Controls: Non-blocking input handling
  • Memory Management: Automatic cleanup of expired visual elements

๐Ÿ› ๏ธ Technical Details

Built With

  • Rust
  • Ratatui: Terminal UI framework
  • Rodio: Audio playback library
  • Symphonia: Audio format decoder
  • Crossterm: Cross-platform terminal manipulation
  • Image: Image processing for visual assets

Architecture

  • Modular Design: Separated UI components and audio logic
  • State Management: Centralized jukebox state with canvas rendering
  • Real-time Updates: Fully handled UI updates with frame rendering

๐Ÿ“‹ Requirements

System Requirements

  • OS: Windows, macOS, or linux
  • Terminal: Support for 256 colors and Unicode characters
  • Audio: System audio output capability

Dependencies

All dependencies are managed by Cargo and will be installed automatically.

๐Ÿ–ผ๏ธ Customizing Visual Assets

Adding Your Own Jukebox Background

  1. Prepare the Image:

    • Any image format supported by the image crate (PNG, JPEG, GIF, etc.)
    • Recommended: High resolution for better terminal display
    • The image will be automatically resized to fit your terminal
  2. Replace the Background:

    # Replace the default jukebox background
    cp your-jukebox-image.png img/jukebox.png

Adding Custom Musical Notes

  1. Prepare Note Images:

    • Format: PNG files (for transparency support)
    • Size: 16x16 pixels (will be randomly resized to 6x6-12x12 during playback)
    • Transparency: Use alpha channel for proper note rendering
    • Content: Musical note symbols, treble clefs, or any musical imagery
  2. Add Note Images:

    # Add your custom notes to the notes directory
    cp note-treble.png img/notes/
    cp note-quarter.png img/notes/
    cp note-eighth.png img/notes/
    # ... add as many as you want
  3. Note Behavior:

    • All PNG files in img/notes/ are automatically loaded
    • Notes are randomly selected during playback
    • Each note is randomly resized between 6x6 and 12x12 pixels
    • Transparent pixels are preserved for proper overlay on jukebox background

Tips for Best Results

  • Jukebox Background: Use images with good contrast for better text readability
  • Musical Notes: Create notes with distinct colors for visual variety
  • File Names: Any valid filename works (e.g., treble.png, quarter-note.png)
  • Quantity: Add 5-10 different note designs for good visual variety

Example Note Collection

img/notes/
โ”œโ”€โ”€ treble-clef.png
โ”œโ”€โ”€ quarter-note.png
โ”œโ”€โ”€ eighth-note.png
โ”œโ”€โ”€ musical-staff.png
โ””โ”€โ”€ sharp-symbol.png

๐Ÿ“„ License

This project is licensed under the MIT License - see the LICENSE file for details.

๐Ÿ™ Acknowledgments

  • Built with the amazing Rust ecosystem
  • Inspired by classic jukebox interfaces
  • Musical note assets and jukebox imagery

๐Ÿ› Troubleshooting

Common Issues

No songs detected

  • Jukebox-cli supports only mp3 files as of now
  • Ensure MP3 files are in the specified directory
  • Check file permissions

Visual artifacts

  • Ensure terminal supports 256 colors
  • Try resizing terminal window

Audio not playing

  • Check system audio settings
  • Ensure audio output device is available

Performance issues

  • Try reducing terminal size

Made with โค๏ธ and ๐ŸŽต in Rust

About

Jukebox MP3 CLI player in Rust

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages