An open API service indexing awesome lists of open source software.

https://github.com/satvikvirmani/musicfp

A terminal based media player for programmers
https://github.com/satvikvirmani/musicfp

hactoberfest linux macos media multimedia playback playmedia python python-vlc songs videos vlc

Last synced: about 1 month ago
JSON representation

A terminal based media player for programmers

Awesome Lists containing this project

README

          

# ๐ŸŽต musicfp

> A sleek, terminal-based media player built for programmers who love their command line.

[![Python Version](https://img.shields.io/badge/python-3.0%2B-blue.svg)](https://www.python.org/downloads/)
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
[![Development Status](https://img.shields.io/badge/status-stable-green.svg)](https://github.com/SatvikVirmani/musicfp)

---

## ๐ŸŽฏ What is musicfp?

**musicfp** (music for programmers) is a powerful yet minimalist media player that lives entirely in your terminal. No GUI bloat, no unnecessary featuresโ€”just pure, efficient audio playback controlled by simple commands. Perfect for developers who want to stay in the terminal while enjoying their favorite music.

## โœจ Features

- ๐ŸŽผ **Dual Playback Modes** - Play single files or entire directories
- ๐Ÿ”€ **Shuffle Support** - Randomize your playlist with a simple flag
- ๐ŸŽš๏ธ **Real-time Volume Control** - Adjust volume on the fly
- โฏ๏ธ **Complete Playback Controls** - Pause, skip, next, previous, and more
- ๐Ÿงต **Multi-threaded Architecture** - Responsive controls that don't block playback
- ๐Ÿ“Š **Metadata Display** - See song and album information for single files
- ๐ŸŽญ **Wide Format Support** - Supports MP3, FLAC, M4A, MP4, WAV, WMA, AAC, and MKV
- ๐Ÿ’ป **Terminal-native** - Stay productive without leaving your workflow

---

## ๐Ÿš€ Installation

### Using pip (Recommended)

```bash
pip install musicfp
```

### From Source

```bash
git clone https://github.com/SatvikVirmani/musicfp.git
cd musicfp
pip install -e .
```

### Requirements

- Python 3.0 or higher
- python-vlc library (automatically installed)

---

## ๐Ÿ“– Usage

### Basic Commands

```bash
# Play a single audio file
musicfp /path/to/song.mp3

# Play all songs in a directory
musicfp /path/to/music/folder

# Play with shuffle enabled
musicfp /path/to/music/folder --shuffle
# or
musicfp /path/to/music/folder -s

# Play all songs in current directory
musicfp current
```

### In-Player Commands

#### When Playing a Single File

| Command | Description |
|---------|-------------|
| `skip` | Skip the current song |
| `pause` | Pause playback |
| `resume` | Resume playback |
| `repeat` | Restart the current song |
| `vol` | Set volume (e.g., `vol75` for 75%) |
| `quit` | Exit the player |
| `help` | Show available commands |

#### When Playing Multiple Files (Directory)

| Command | Description |
|---------|-------------|
| `pause` | Pause/resume playback |
| `next` | Play next song |
| `previous` | Play previous song |
| `vol` | Set volume (e.g., `vol50` for 50%) |
| `quit` | Exit the player |
| `help` | Show available commands |

---

## ๐ŸŽฎ Examples

### Example 1: Playing a Single Song

```bash
$ musicfp ~/Music/favorite-song.mp3
Playing "Favorite Song" from "Best Album"
>> vol80
Volume set to 80%
>> pause
Paused
>> resume
Resumed
>> quit
```

### Example 2: Playing a Directory with Shuffle

```bash
$ musicfp ~/Music/Playlist --shuffle
Playing all songs from directory: /home/user/Music/Playlist with shuffle ON
>> next
>> vol60
Volume set to 60%
>> quit
```

### Example 3: Quick Play from Current Directory

```bash
$ cd ~/Music/WorkoutMix
$ musicfp current -s
Playing all songs from directory: /home/user/Music/WorkoutMix with shuffle ON
>>
```

---

## ๐ŸŽจ Supported Formats

musicfp supports a wide range of audio and video formats:

- **Audio**: MP3, FLAC, M4A, WAV, WMA, AAC
- **Video**: MP4, MKV (audio extraction)

---

## ๐Ÿ—๏ธ Project Structure

```
musicfp/
โ”œโ”€โ”€ LICENSE # MIT License
โ”œโ”€โ”€ pyproject.toml # Build configuration
โ”œโ”€โ”€ setup.py # Package setup
โ”œโ”€โ”€ README.md # This file
โ””โ”€โ”€ src/
โ””โ”€โ”€ musicfp/
โ”œโ”€โ”€ __init__.py # Package initializer
โ””โ”€โ”€ __main__.py # Main application logic
```

---

## ๐Ÿ”ง How It Works

musicfp uses a multi-threaded architecture to provide responsive controls:

1. **Playback Thread** - Handles media loading and playback using VLC
2. **Input Thread** - Listens for user commands without blocking playback

The application leverages `python-vlc`, Python bindings for the powerful VLC media player, ensuring robust and reliable playback across all supported formats.

---

## ๐Ÿ‘จโ€๐Ÿ’ป About the Author

**Satvik Virmani**

- ๐Ÿ“ง Email: virmanisatvik01@gmail.com
- ๐Ÿ™ GitHub: [@satvikvirmani](https://github.com/satvikvirmani)
- ๐Ÿ”— Project: [musicfp](https://github.com/SatvikVirmani/musicfp)

---

## ๐Ÿ› Bug Reports & Feature Requests

Found a bug or have an idea for a new feature?

- **Report issues**: [GitHub Issues](https://github.com/SatvikVirmani/musicfp/issues)
- **Contribute**: Pull requests are welcome!

---

## ๐Ÿ“„ License

This project is licensed under the **MIT License** - see the [LICENSE](LICENSE) file for details.

```
Copyright (c) 2018 The Python Packaging Authority

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
```

---

## ๐ŸŒŸ Show Your Support

If you find musicfp useful, please consider:

- โญ Starring the repository
- ๐Ÿฆ Sharing it with fellow developers
- ๐Ÿด Forking and contributing improvements

---

## ๐Ÿ’ก Why musicfp?

As developers, we spend countless hours in the terminal. Why switch contexts just to control music? musicfp keeps you in your flow state, letting you control your soundtrack with the same efficiency you bring to your code.

**Stay in the terminal. Stay productive. Stay in the zone.**

---

Made with โค๏ธ by Satvik Virmani

**[โฌ† back to top](#-musicfp)**