Results 1 to 10 of 10

Thread: HOW TO: Convert any audio to an mp3

  1. #1
    Join Date
    Mar 2006
    Location
    PA
    Beans
    33
    Distro
    Ubuntu 6.06

    Talking HOW TO: Convert any audio to an mp3

    I have spent weeks trying to figure out how to convert my .rm and .ram files to mp3. I finally found it by searching for something to encode an mp3 from a wma. This works for wma, RealMedia or any other format that your mplayer is set up to play.

    Also so everyone knows I did not come up with this on my own, I found it here and had to make some changes to make it compatible with enhancements in mplayer.

    1. open gedit to a blank document (Applications >Accessories>Text Editor)

    2. copy this text into it, then save it as wmamp3 (or whatever format you use it for)

    #!/bin/bash

    current_directory=$( pwd )

    #remove spaces
    for i in *.ram; do mv "$i" `echo $i | tr ' ' '_'`; done

    #remove uppercase
    for i in *.ram; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done

    #Rip with Mplayer / encode with LAME
    for i in *.ram ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $i && lame -m s audiodump.wav -o $i; done

    #convert file names
    for i in *.ram; do mv "$i" "`basename "$i" .ram`.mp3"; done

    rm audiodump.wav

    3. For wma use this, or for other formats anywhere you see .wma change it to .rm or .ogg or.mov, use it for anything mplayer can play

    4. Open a terminal (Applications>Accessories>Terminal) and make sure you are in the directory the file was saved in

    5. make it executable with:
    chmod +x wmamp3 (or for other to use it too use a+x for +x)

    6. and copy it to your script folder with:
    sudo cp wmamp3 /usr/bin/
    (you'll want to rename other iterations things like rmmp3, movmp3 and change the line accordingly)

    7. Then use it by going to the folder in terminal and typing wmamp3

    WARNING!! This will change ALL your files in that folder of the type specified to an mp3 and remove the old files. Create backups of your files first and test it on your system to make sure you have everything configured properly!!

    Notes:
    I'm not sure I like the quality of the files made by lame, i may change later to toolame or if anyone knows of a better mp3 encoder I'm all ears for better options. Also, you can use this to convert to ogg, wma or anything you have an encoder for. I hope this helps anyone looking for a quick solution to convert large amounts of files.

    On my system it took about 15 seconds to convert each rm file to mp3.

    Good luck!

  2. #2
    Join Date
    Feb 2006
    Beans
    168
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO: Convert any audio to an mp3

    The perl audio converter pac will do the job as well, although it is rather a grief to install

    --evaristegalois

  3. #3
    Join Date
    Feb 2006
    Beans
    168
    Distro
    Ubuntu 14.04 Trusty Tahr

    Re: HOW TO: Convert any audio to an mp3

    FANTASTIC! I spent hours trying to re-install the perl audio converter pac which once upon a time I had working but couldn't get re-installed, and now you have given such an elegant solution for the problem. Thanks!

    --evaristegalois

  4. #4
    Join Date
    Jun 2006
    Beans
    26

    Re: HOW TO: Convert any audio to an mp3

    great how-to. using it right now and it's working fantastically.

    however, i think there might be a typo under point 3. the script you've written is NOT for wma files, it's for .ram (real audio? i have no idea) files. easy enough for most to figure out, but still.

  5. #5
    Join Date
    Jul 2006
    Location
    Pomezia, Rome, IT
    Beans
    825
    Distro
    Ubuntu 9.04 Jaunty Jackalope

    Talking Re: HOW TO: Convert any audio to an mp3

    Thanks a lot for this very useful script, I really appreciate your how-to

  6. #6
    Join Date
    Nov 2005
    Beans
    8
    Distro
    Ubuntu 6.06

    Re: HOW TO: Convert any audio to an mp3

    it's just GREAT!

    Adam

  7. #7
    Join Date
    Nov 2006
    Location
    New Zealand
    Beans
    6
    Distro
    Ubuntu 7.10 Gutsy Gibbon

    Re: HOW TO: Convert any audio to an mp3

    Brilliant - just used it to convert a bunch of FLACs created by Sound Juicer from an audio CD

  8. #8
    Join Date
    Jul 2005
    Beans
    17

    Re: HOW TO: Convert any audio to an mp3

    I must be missing something. Evertime I execute the script I get the following:



    -aofile is deprecated. Use -ao pcm:file=<filename> instead.
    MPlayer 2:0.99+1.0pre8-0ubuntu8 (C) 2000-2006 MPlayer Team
    CPU: Genuine Intel(R) CPU T2500 @ 2.00GHz (Family: 6, Model: 14, Stepping: 8)
    CPUflags: MMX: 1 MMX2: 1 3DNow: 0 3DNow2: 0 SSE: 1 SSE2: 1
    Compiled with runtime CPU detection.

  9. #9
    Join Date
    Jun 2007
    Beans
    86
    Distro
    Xubuntu 10.04 Lucid Lynx

    Re: HOW TO: Convert any audio to an mp3

    I got something similar but then I fixed the parts that say ".ram" into ".rm" in the script. If you are converting wma files then your .ram should say .wma.
    I installed ubuntu 18.4.2007.

  10. #10
    Join Date
    May 2008
    Beans
    235
    Distro
    Ubuntu 10.10 Maverick Meerkat

    Re: HOW TO: Convert any audio to an mp3

    Can't thank you enough aarbear26. Simple, elegant and it works, five years after.

    I'll just put it in code tags and remind the users to first install mplayer and lame, if you don't already have them. To do so, simply run the following commands from the terminal/command line:

    To install MPlayer:
    Code:
    sudo apt-get install mplayer
    To install LAME:
    Code:
    sudo apt-get install lame
    Here is the script in code tags:

    Code:
    #!/bin/bash
    
    current_directory=$( pwd )
    
    #remove spaces
    for i in *.ram; do mv "$i" `echo $i | tr ' ' '_'`; done
    
    #remove uppercase
    for i in *.ram; do mv "$i" `echo $i | tr '[A-Z]' '[a-z]'`; done
    
    #Rip with Mplayer / encode with LAME
    for i in *.ram ; do mplayer -vo null -vc dummy -af resample=44100 -ao pcm:waveheader $i && lame -m s audiodump.wav -o $i; done
    
    #convert file names
    for i in *.ram; do mv "$i" "`basename "$i" .ram`.mp3"; done
    
    rm audiodump.wav
    If you want to convert from "rm" to mp3, simply change all the instances of "ram" to "rm".

    I am running Ubuntu 10.10 and this worked perfectly.
    Last edited by newbuntuxx; June 11th, 2011 at 10:22 PM.

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
  •