Find the answer to your Linux question:
Results 1 to 3 of 3
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1

    mp3gain bash script

    Hi guys
    I'm trying to get a mp3gain script to work.
    Basically all it has to do is run "mp3gain -r -k $file" on my mp3's. The problem is they are all in different dirs.

    for file in `find . -name '*.mp3'`; do
        mp3gain -r -k $file
    The problem is, it treets all the different words in $file as a new command. Eg:

    mp3gain -r -k the
    mp3gain -r -k quick
    mp3gain -r -k fox.mp3
    Any ideas? Or even a better script that will work? Keep in mind there are like 8000 mp3s, so this script won't work:
    find . -type f -iname '*.mp3' -print0 | xargs -0 mp3gain -r -k
    because for some reason it only see the first 1399 files.

  2. #2
    Simple solutions are the best.

    for file in `find . -name '*.mp3'`; do
    mp3gain -r -k "$file"
    And for an even simpler way:

    find . - name '*.mp3' -exec mp3gain -r -k {} \;

  3. #3

    Homebrew MP3Gain / eyeD3 Script

    This might be helpful to others . . . .

    # Kevin Carpenter Feb 2011
    # Note: This was run on a PC running the Linux OS (Ubuntu Hardy Herron)
    # ---------------------------------------------------------------------
    # Script Goals
    # Convert tag versions to 2.4 so that Album name could be changed.
    # Change albumn name of all mp3 files to match current folder name.
    # Why - Safer driving - all PodCasts on Sansa Clip would be in one folder.
    # - - - - - - -
    # Normalize audio level of all mp3 files.
    # Why - avoid ear damage while sleeping with MP3 player still running.
    # ----------------------------------------
    # Dependancies
    # Install:
    # eyeD3 - free commandline MP3 Tag Editor
    # MP3Gain - free commandline MP3 Audio Normalizer
    # ----------------------------------------
    # converts mp3 tag versions up to version 2.4
    eyeD3 --to-v2.4 *.mp3

    # normalize audio of all MP3 files in current directory
    mp3gain -r -k *mp3

    # Assigns the name of the current directory to variable BN
    BN=$(basename `pwd`)

    # Sets the albumn name, for all MP3 files in current directory, to match the name of the current directory
    eyeD3 -A "$BN" *.mp3

  4. $spacer_open

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts