Close
0%
0%

Pirate Audio Player

Raspberry Pi Zero MP3 player for Pimoroni Pirate Audio: plays MP3/FLAC/WAV via mpv, cover art, folder browser, UPS battery support.

Similar projects worth following
0 followers
pirateplayer: an open-source Raspberry Pi Zero MP3 player for the Pimoroni Pirate Audio HAT

pirateplayer turns a Raspberry Pi Zero, a Pimoroni Pirate Audio HAT and a UPS battery board into a portable, battery-powered music player. Written in Python, it plays MP3, FLAC and WAV files from your music folder through mpv, with video disabled so it stays lightweight enough for the Pi Zero’s limited CPU and RAM.

Features

  • Plays MP3, FLAC and WAV, with tags read from ID3, Vorbis comments and RIFF INFO
  • Folder browser and now-playing screen on the Pirate Audio’s 240×240 ST7789 LCD, with album cover art from embedded images or cover.jpg/folder.jpg
  • Four-button control: tap, hold and repeat gestures for navigation, volume, play/pause and track skipping, plus an A+B combo to power off
  • Resume playback: remembers your playlist, track, position and volume across reboots, and resumes paused
  • Battery monitoring for the Waveshare UPS HAT (C) and PiSugar 2/3, with an on-screen battery gauge and automatic clean shutdown on low battery
  • Power saving: the screen turns off after 30 seconds idle
  • Desktop simulator: test the player on Linux, macOS or Windows in a pygame window that emulates the screen, buttons, battery and audio

Easy setup

A single install script configures Raspberry Pi OS (Bookworm or later, including Lite). It installs mpv and the Python dependencies, enables SPI, I2C and the HiFiBerry DAC overlay, and sets pirateplayer up as a systemd service that starts at boot. To add music, copy files to ~/Music over the network with scp or rsync. Settings such as the music folder, screen timeout, battery type and audio device can be changed in a simple TOML config file.

Who it’s for

pirateplayer suits anyone building a DIY MP3 player, Raspberry Pi music player or offline portable audio player: maker projects, kids’ music players, or a distraction-free alternative to a phone.

Keywords: Raspberry Pi Zero music player, Pirate Audio MP3 player, DIY portable audio player, Raspberry Pi FLAC player, mpv Python music player, PiSugar, Waveshare UPS HAT.

  • 1 × Raspberry Pi Zero W Get it with the Headers pre soldered to avoid having to solder on header pins.
  • 1 × Pirate Audio Headphone Hat
  • 1 × Waveshare UPS Hat C Comes with a 1000mah battery

  • MVP: 0.1.0

    Daniel Baker • an hour ago • 0 comments

    This is the MVP of the project. I have a lot more ideas to add in the backlog but right now it plays audio over bluetooth and the headphone jack, allows file exploring and plays flac, wav, or mp3 which covers all of my library.

View project log

Enjoy this project?

Share

Discussions

Does this project spark your interest?

Become a member to follow this project and never miss any updates