Page 1 of 2 12 LastLast
Results 1 to 10 of 18

Thread: How to convert pesky .m4a to .mp3

Hybrid View

  1. #1
    Join Date
    Jan 2005
    Location
    Washington DC
    Beans
    329

    How to convert pesky .m4a to .mp3

    I recently got a bunch of m4a files from a mac user from her band...I know I can play it with amarok but not xmms. Also why not just use mp3s which you know everyone and their grandma can use. So below is a quick bash script to automate the process. I'm sure there is a quicker way...but you can use this to convert to mp3s or ogg vorbis or whatever format you like.

    Code:
    #!/bin/bash
    #
    # Dump m4a to wav (first step in conversion)
    
    y=`pwd`
    cd "$1"
    
    echo changing directory to $1
    sleep 15
    echo converting the damned .m4as to mp3s
    for i in *.m4a
    do
    mplayer -ao pcm "$i" -aofile "$i.wav"
    done
    
    echo converting the damned .wavs to mp3s
    for i in *.wav
    do
    lame -h -b 192 "$i" "$i.mp3"
    done
    
    echo renameding the damned mp3s
    for i in *.mp3
    do
    x=`echo "$i"|sed -e 's/m4a.wav.mp3/mp3/'`
    mv "$i" "$x"
    done
    
    rm *.wav
    rm *.m4a
    cd $y
    
    echo changing back to $y

  2. #2
    Join Date
    Jul 2005
    Beans
    36

    Re: How to convert pesky .m4a to .mp3

    You should try downloading a program called "gnormalize". It will allow you to convert one or an entire directory of MP4 files into MP3 or another output format. Works great, and has a graphical interface to boot.


    http://gnormalize.sourceforge.net/

  3. #3
    Join Date
    Jan 2005
    Location
    Washington DC
    Beans
    329

    Re: How to convert pesky .m4a to .mp3

    Quote Originally Posted by dbeckham32
    You should try downloading a program called "gnormalize". It will allow you to convert one or an entire directory of MP4 files into MP3 or another output format. Works great, and has a graphical interface to boot.


    http://gnormalize.sourceforge.net/
    thanks for the info will install it on my desktop. I wrote the script for the fileserver which holds my music which doens't have X installed so I wanted something to do over ssh. However I will definately in the future convert files before I move them to my fileserver. Thanks again

  4. #4
    Join Date
    Jan 2005
    Location
    Lexington, Kentucky
    Beans
    150
    Distro
    Ubuntu Karmic Koala (testing)

    Re: How to convert pesky .m4a to .mp3

    lol, funny thing is, I had to convert a bunch of m4a's that my bro gave me to mp3's so I can transfer them to my ipod with gtkpod, and had come up with this script:

    #!/bin/bash
    for i in *.m4a; do
    out=$(ls "$i" | sed -e 's/.m4a//g')
    faad -w "$i" > "$out.wav"
    done
    for i in *.m4b; do
    out=$(ls "$i" | sed -e 's/.m4b//g')
    faad -w "$i" > "$out.wav"
    done
    for i in *.wav; do
    out=$(ls "$i" | sed -e 's/.wav//g')
    lame -h -b 64 "$i" "$out.mp3"
    done

    rm *.wav
    Your's seems to give more info than mine does, but mine uses faad instead of mplayer. Great minds think quite similar.

    Also, I've heard about gnormailize, but hadn't tryed it out. Wish I would have seen it before I set this up as a nautilus script lol

  5. #5
    Join Date
    Nov 2007
    Location
    British Columbia, Canada
    Beans
    46
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to convert pesky .m4a to .mp3

    The second script worked better for me. I misfired on the first script and ended up wiping out my songs...my bad, just didn't read the script thouroughly enough
    "Gravity is a harsh mistress" -The Tick

    Ubuntu Stoke <-my blog of "things and stuff" usually about Ubuntu

  6. #6
    Join Date
    Nov 2007
    Location
    British Columbia, Canada
    Beans
    46
    Distro
    Ubuntu 9.10 Karmic Koala

    Re: How to convert pesky .m4a to .mp3

    Well, unfortunately the mp3's I ended up with were nothing but static. ...trying to find another way
    "Gravity is a harsh mistress" -The Tick

    Ubuntu Stoke <-my blog of "things and stuff" usually about Ubuntu

  7. #7
    Join Date
    Jan 2012
    Location
    Oregon, USA
    Beans
    58

    Re: How to convert pesky .m4a to .mp3

    Quote Originally Posted by dbeckham32 View Post
    You should try downloading a program called "gnormalize". It will allow you to convert one or an entire directory of MP4 files into MP3 or another output format. Works great, and has a graphical interface to boot.


    http://gnormalize.sourceforge.net/

    How does one install this? I'm a total noob and need explicit instructions/code. the code on the dl page didn't work. I only just figured out that this is why I'm not getting half my music.

  8. #8
    Join Date
    Apr 2007
    Beans
    32
    Distro
    Ubuntu 8.10 Intrepid Ibex

    Re: How to convert pesky .m4a to .mp3

    Quote Originally Posted by Airycat View Post
    How does one install this? I'm a total noob and need explicit instructions/code. the code on the dl page didn't work. I only just figured out that this is why I'm not getting half my music.
    Near the bottom of the http://gnormalize.sourceforge.net/ page there is:


    To install gnormalize, with root privilege, execute the bash script command:
    tar zxvf gnormalize-version.tar.gz
    cd gnormalize-version/
    ./install

    So you must download it (click on the link on that page), open a terminal window (google it), then type the commands as you see them. The first extracts files out of the "gnormalize-version.tar.gz" archive. The second changes your current directory into the newly extracted one. The third run installs the software.
    --
    qneill

  9. #9
    Join Date
    May 2008
    Beans
    77

    Re: How to convert pesky .m4a to .mp3

    Great script! However, you may want to consider using named pipes to avoid the intermediate .wav step i.e.
    Code:
    mkfifo pipe.wav
    
    lame [whatever options] pipe.wav output.mp3
    
    mplayer -ao pcm:file=pipe.wav source.m4a
    Last edited by nunki; February 23rd, 2009 at 06:48 PM.

  10. #10
    Join Date
    Nov 2008
    Beans
    88

    Re: How to convert pesky .m4a to .mp3

    please some one tell me how to use these scripts properly. please?

Page 1 of 2 12 LastLast

Bookmarks

Posting Permissions

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