Skip to content

A python script to run background music in EmulationStation for Retropie

Notifications You must be signed in to change notification settings

JSAURAJ/bgm-for-es

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Background Music for EmulationStation

A python script to run background music in EmulationStation for Retropie, inspired by the script posted in https://retropie.org.uk/forum/topic/347/background-music-continued-from-help-support, but focusing on a script with well-written code, trying to follow good design practices and putting special attention on testability

How to install

Enter the RetroPie console (you can reach it by pressing the F4 key when EmulationStation is running) and run the following commands:

sudo sh -c 'echo "deb [trusted=yes] https://repo.fury.io/rydra/ /" > /etc/apt/sources.list.d/es-bgm.list'
sudo apt update
sudo apt install python-pygame python-es-bgm

These commands will update your sources and install the python-es-bgm package which will run your music. Afterwards, place your music in the music folder (as described in the How it works section and either restart EmulationStation or reboot your Raspberry. Enjoy your new EmulationStation with background music.

sudo reboot

After the reboot, a daemon service called bgm will be running in the background, playing your music when EmulationStation is actively running and fading down when you start an emulator.

How it works

Place your music in .mp3 or .ogg format in the folder that will be created in /home/pi/RetroPie/roms/music. You can change the folder where you place your music in the settings.

If you want to manually execute the application you can execute the following command:

Configuration

The configuration file that you may find in /etc/bgmconfig.ini contains the following content:

[default]
startdelay = 0
musicdir = /home/pi/RetroPie/roms/music
restart = True
startsong =
Option Default value Description
startdelay 0 How much time in second you want to wait once EmulationStation starts before playing the first song
musicdir /home/pi/RetroPie/roms/music How much time in second you want to wait once EmulationStation starts before playing the first song
restart True How much time in second you want to wait once EmulationStation starts before playing the first song
startsong Empty The exact name of the song you want to play in first place. Leave empty to let the player decide randomly

If you want to override these settings, you can create a file in your personal folder called .bgmconfig.ini (so, in the path ~/.bgmconfig.ini) containing [default] in the first line and override any option you want.

How to create a debian package from this source code

There is a make task that will do this job for you:

make debian-package

About

A python script to run background music in EmulationStation for Retropie

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 96.4%
  • Makefile 1.9%
  • Shell 1.7%