1

I know how to normalize a song to 100%, but I'd like this to happen automatically before copying the files on my iPod, via Rhythmbox.

So, I imagine a process like this:

  • create my own playlist
  • when clicking Sync button, the songs will be copied in a temp directory
  • they will be normalized to 100% there
  • finally they will be copied to my iPod

Is there a plugin for that? How can I do this?


I want this, because the max volume for iPods is pretty low.

  • There is a way to monitor a special folder and to automatically run a script (f.i. normalize with mp3gain) when a file is created in. Not sure it is what you want: Interested ? – laugeo Oct 08 '14 at 17:21
  • Well, that should be very simple. But I would really like a plugin that does this job automatically when trying to copy songs on iPod. – Ionică Bizău Oct 08 '14 at 17:34
  • @laugeo Even that would be helpful. It will be a starter point. Can you add it here? – Ionică Bizău Oct 22 '14 at 08:53

1 Answers1

2

You can use inotify which is a folder monitoring software: it launch a command when a file is created . Here, it will launch mp3gain . To set up :

  1. Install

sudo apt-get install inotify-tools incron mp3gain

  1. edit incron.allow

sudo gedit /etc/incron.allow
then add your username , save , you may reboot (not sure but ...)

  1. Choose or create a folder where sound files will be copied and then normalized
    (Here I create a new folder "normalize" in my home dir. but you may use existing folder be on your usb device,
    something like /media/ipod/music)

mkdir ~/normalize

  1. Run incrontab -e and copy this line in the editor (replace 2 "username" with your login ) :
    /home/username/normalize IN_CREATE /home/username/normalize.bash $@/$#
    Save and close editor .
    This set the monitored folder and the command executed when a file is created in (command is normalize.bash ).

(If you have problem with default editor , you can change it to pico (gedit don't work for me) : Run this before incrontab -e : export EDITOR=pico )

  1. Create a new file normalize.bash containing this :
#!/bin/bash
PATH1=/home/username/normalize    
echo "***********************************************************"  >> ~/normalize.log
 date >> ~/normalize.log   
#get extension to exit on TMP files
filename=$(basename "$1")
extension="${filename##*.}"   
if [[ "$extension" = "TMP" ]]
 then
echo TMP exit>> ~/normalize.log
 exit
 fi   
# do normalize
/usr/bin/mp3gain -c -r "$1"   >> ~/normalize.log   
#END    

In second line change PATH1 to the previously created/existing folder. Save as normalize.bash in your home.

Now, when a file is created in the folder "normalize", mp3gain will run (actions are logged in normalized.log file in home dir)

laugeo
  • 2,827