A feature-rich web-based MP3 player designed specifically for Raspberry Pi with a 3.5" touch screen display. This player supports both AUX output and Bluetooth connections, providing a versatile audio solution for your Raspberry Pi.
-
Music Playback
- Play/pause, skip tracks, volume control
- Adjustable playback speed
- Forward/backward 10 seconds buttons
- Interactive seek bar for precise navigation
-
Playlist Management
- Create and manage multiple playlists
- Add tracks from the file browser
- Batch add tracks by scanning directories
- Shuffle and loop modes
-
File Browser
- Browse file system to find music
- Automatic scanning for MP3 files
- Support for multiple storage locations
-
Bluetooth Support
- Scan for devices
- Pair and connect to Bluetooth speakers/headphones
- Manage connected devices
-
Touch-Optimized UI
- Large buttons for easy touch interaction
- Simple, intuitive interface designed for small screens
- Virtual keyboard for text input
-
Audio Visualization
- Three visualization modes: bars, wave, and circle
- Responsive to audio frequency changes
- Customizable appearance
- Raspberry Pi (Any model, Pi 3 or newer recommended)
- 3.5" touch screen display
- Speakers or headphones (via AUX output)
- Bluetooth capabilities (built-in or USB dongle)
- Node.js installed on your Raspberry Pi
curl -fsSL https://deb.nodesource.com/setup_16.x | sudo -E bash -
sudo apt-get install -y nodejs
git clone https://github.com/yourusername/pi-mp3-player.git
cd pi-mp3-player
Alternatively, download and extract the project files maintaining the folder structure.
npm install
mkdir -p data music
Edit your autostart configuration:
sudo nano /etc/xdg/lxsession/LXDE-pi/autostart
Add these lines:
@xset s off
@xset -dpms
@xset s noblank
@chromium-browser --kiosk --app=http://localhost:3000 --start-fullscreen
For AUX output, make sure your Raspberry Pi's audio is set to the headphone jack:
sudo raspi-config
Navigate to System Options → Audio → Force 3.5mm ('headphone') jack
Make sure Bluetooth is enabled:
sudo bluetoothctl
power on
agent on
default-agent
quit
npm start
Add the startup command to crontab:
crontab -e
Add this line (replace with your actual path):
@reboot cd /home/pi/pi-mp3-player && npm start
pi-mp3-player/
├── package.json
├── server.js
├── routes/
│ ├── files.js
│ ├── playlists.js
│ └── bluetooth.js
├── public/
│ ├── css/
│ │ ├── styles.css
│ │ ├── keyboard.css
│ │ └── visualizer.css
│ ├── js/
│ │ ├── player.js
│ │ ├── fileBrowser.js
│ │ ├── playlist.js
│ │ ├── bluetooth.js
│ │ ├── keyboard.js
│ │ └── visualizer.js
│ ├── img/
│ │ ├── icons/
│ │ └── backgrounds/
│ └── index.html
└── data/
└── playlists.json
- Use the bottom navigation bar to switch between views:
- Now Playing: Shows the current track and playback controls
- Browse: File browser to find and play music
- Playlists: Manage and play your playlists
- Navigate to the Browse tab
- Browse to a directory containing MP3 files
- Tap on an MP3 file to play it
- Use the controls to adjust volume, speed, and playback position
- Navigate to the Playlists tab
- Tap "New Playlist"
- Enter a name using the on-screen keyboard
- Add tracks from the file browser or by scanning directories
- Tap the Bluetooth icon in the header
- Toggle Bluetooth on
- Tap "Scan for Devices"
- Tap "Connect" next to the device you want to connect to
- Tap the settings icon in the header
- Adjust theme and visualization settings
-
If you have no sound from the headphone jack:
amixer controls amixer sset 'PCM' 90%
-
To switch between HDMI and headphone jack:
sudo raspi-config
Navigate to System Options → Audio
-
If Bluetooth scanning doesn't work:
sudo systemctl restart bluetooth
-
Check if Bluetooth is properly enabled:
sudo systemctl status bluetooth
-
To manually pair a difficult device:
sudo bluetoothctl scan on # Wait for device to appear pair [MAC_ADDRESS] connect [MAC_ADDRESS]
-
If the touch screen isn't calibrated properly:
sudo apt-get install -y xinput-calibrator DISPLAY=:0 xinput_calibrator
-
If the touch screen isn't responding:
sudo dpkg-reconfigure xserver-xorg-input-evdev
-
Check crontab is properly set:
crontab -l
-
Check application logs:
journalctl -u cron
This project is licensed under the MIT License - see the LICENSE file for details.