[EN] mp3 player from NAS,or else; play random or not
Made with Pimoroni Pirate Radio and Raspberry Zero W
[FR] lecteur mp3, développé pour une utilisation avec NAS avec le module pHAT BEAT de Pimoroni (pimoroni pirate radio kit) et un Raspberry zero W. Avec le système de mise en veille, pour permettre une utilisation - pas très écologique il est vrai - de la radio 24/24 7/7 par les utilisateurs, sans avoir à relancer de script par exemple.
- ON/OFF button dont stop the program ! = SLEEP MODE
- OFF mode will blink VUmeter every X seconds until power ON is set back
- 2 play modes : random or track after track
- builds a tracklist based on a directory and subdirectories
- every action is displayed on console
- playing track displayed in console
Maybe I was not 'lucky' enough, but I did not find any script to fill my needs/hardware around a network mp3 player with .php and some functions like a ON/OFF button that don't quit the main program.
- le bouton ON/OFF ne quitte pas le programme
- clignotement du VUmetre pour indiquer le mode veille (OFF)
- 2 modes de lecture : aléatoire ou simple
- construit une playlist à partir d'un dossier et ses sous repertoires
- toute action est affichée en console
- titre mp3 en lecture/chargé est affiché sur la consolle
Je n'ai pas trouvé sur github ou ailleurs un programme python qui corresponde à mes besoins/matériels. Ce qui explique la création et le partage de celui ci.
sudo visudo
www-data ALL=(ALL) NOPASSWD: /usr/bin/python
sudo adduser www-data gpio
- running mypirateradio.py with button on web page should work
- .php to supervise playing and ressources
- use of holding button to change within different directories/internet source/etc. or run other pyhton script
- .php explore tracklist
sudo apt remove --purge pulseaudio
sudo nano /etc/asound.conf
- pulseaudio by itself was using 30/40% without any program running. Versus 1% for Alsa.
- better performances with Alsa, and ON/OFF button use in MyPirateRadio to PAUSE music and unload CPU.
- phatbeat uses 100% for playing a track... as a simple mp3 player...., there may be a way to reduce that no !?
pHAT-beat
- https://github.com/pimoroni/phat-beat
- https://pinout.xyz/pinout/phat_beat#
- https://learn.pimoroni.com/tutorial/sandyj/getting-started-with-phat-beat
ideas to include :
I took ideas and code from:
use python 2
- python pirateradio.py