Author Topic: music script motion blue  (Read 300 times)

drewjbx1

  • Newbie
  • *
  • Posts: 6
    • View Profile
music script motion blue
« on: December 17, 2019, 04:15:39 PM »
Using David Marti's motion blue still, want to turn down the background music volume but cannot find the location of the script to edit. Anyone know the location of this file?

dmmarti

  • Full Member
  • ***
  • Posts: 62
    • View Profile
Re: music script motion blue
« Reply #1 on: December 17, 2019, 04:29:52 PM »
There isn't a script to edit that has options for background music volume.

It just uses the mpg123 sound player to either play music or not.  There's no config adjustment for mpg123 music player.

There are other scripts out there for RetroPie that have adjustments like that, but they have other quirks that make the whole process more tedious.

This one uses the runcommand-onstart and runcommand-onend scripts to either play or not play.  That's it.

However, I "think" you can do something like this.

/opt/retropie/configs/all

Look at the autostart.sh and you should see this line:

(sleep 10; mpg123 -Z /home/pi/RetroPie/roms/music/*.mp3 >/dev/null 2>&1) &

I think the "-f" flag can be used to decrease the volume (but this is untested)........just found it in the help manual.

The -f flag is the scale factor and I think it controls the amplitude of the mpg123 output.

Maximum value is:  32768

So....to set the background music to 50%, it would be:  16384

So change that line to:

(sleep 10; mpg123 -f 16384 -Z /home/pi/RetroPie/roms/music/*.mp3 >/dev/null 2>&1) &

.....then restart your Pi and see if that works.

25% volume would be:  8192

(sleep 10; mpg123 -f 8192 -Z /home/pi/RetroPie/roms/music/*.mp3 >/dev/null 2>&1) &
« Last Edit: December 17, 2019, 04:47:33 PM by dmmarti »


drewjbx1

  • Newbie
  • *
  • Posts: 6
    • View Profile
Re: music script motion blue
« Reply #3 on: December 17, 2019, 11:07:30 PM »
There isn't a script to edit that has options for background music volume.

It just uses the mpg123 sound player to either play music or not.  There's no config adjustment for mpg123 music player.

There are other scripts out there for RetroPie that have adjustments like that, but they have other quirks that make the whole process more tedious.

This one uses the runcommand-onstart and runcommand-onend scripts to either play or not play.  That's it.

However, I "think" you can do something like this.

/opt/retropie/configs/all

Look at the autostart.sh and you should see this line:

(sleep 10; mpg123 -Z /home/pi/RetroPie/roms/music/*.mp3 >/dev/null 2>&1) &

I think the "-f" flag can be used to decrease the volume (but this is untested)........just found it in the help manual.

The -f flag is the scale factor and I think it controls the amplitude of the mpg123 output.

Maximum value is:  32768

So....to set the background music to 50%, it would be:  16384

So change that line to:

(sleep 10; mpg123 -f 16384 -Z /home/pi/RetroPie/roms/music/*.mp3 >/dev/null 2>&1) &

.....then restart your Pi and see if that works.

25% volume would be:  8192

(sleep 10; mpg123 -f 8192 -Z /home/pi/RetroPie/roms/music/*.mp3 >/dev/null 2>&1) &

Perfect..  works great! Thanks David