Add MPG123 Terminal Music Player to Raspberry Pi, Linux
MPG123 is a fast console MPEG Audio Player and decoder library. It works in a terminal. It consumes almost no system resources and I use it for background music on my desktop.
I works on standard Linux and Raspberry Pi. To install:
~ $ sudo apt-get install mpg123
The website is https://www.mpg123.de.
How to Use
Open a terminal and type the following and you get the above assuming folder Music is in your home folder and has mp3s:
~ $ aterm -e mpg123 -CvZ ~/Music/*.mp3
With aterm it can be any terminal in your system suck as lxterminal in Raspberry Pi.
Let's set this up as a bash script and save in your $HOME/bin folder. Open a text editor:
# -C, --control Enable terminal control keys.
# -v --verbose
# -Z random loop
aterm -e mpg123 -CvZ ~/Music/*.mp3
Save and close.
This will play every song at in the directory random forever. Leave out -Z and it will play every song in the directory in alphabetical order then exit.
The -C allows one to display a help menu by typing h.
Above is my Python audio menu.
Save the above as mpg123.sh (or rename it anything other than mpg123) in you bin folder or /usr/local/bin. Add the command you your menu.
Make the file executable:
~ $ sudo chmod +x mpg123.sh
Below are various terminal commands.
[s] or [ ] interrupt/restart playback (i.e. 'pause')
[f] next track
[d] previous track
[b] back to beginning of track
[p] pause while looping current sound chunk
[:] fast forward
[;] fast rewind
[+] volume up
[-] volume down
[r] RVA switch
[v] verbose switch
[l] list current playlist, indicating current track there
[t] display tag info (again)
[m] print MPEG header info (again)
[h] this help
- Main Light Fast Linux Desktops with Openbox, JWM
- Test Reuse Surplus PC Power Supplies
- Add WBAR Launch Dock to Raspberry Pi
- Add MPG123 Terminal Music Player to Raspberry Pi, Linux
- Basics of Alsamixer Audio Control for Linux
- Add Solid State Hard Drive to Raspberry Pi
- Beep a PC Speaker Add Beeper to Raspberry Pi
- Using FEH Wallpaper Setter Under Linux
- Web Master
- Gen. Electronics
- YouTube Channel
- Arduino Projects
- Raspberry Pi & Linux
- PIC18F2550 in C
- PIC16F628A Assembly
- PICAXE Projects
- Bristol VA/TN
- US Constitution
- Religious Themes
- Religion Archive 1