Click to See Complete Forum and Search --> : Convert wma files to mp3 or ogg


Sepero
11-25-2004, 04:12 PM
Converting your wma files to ogg format is the preferred way because ogg is an open format and you will never have to worry about patents. Although mp3 is not an open format, at the time of this writting, it is still very popular, so I have included instructions on converting to mp3 format as well.

The programs you must have installed are:
Bash
MPlayer and Microsoft codecs
oggenc ( for creating ogg's )
lame ( for creating mp3's )

1. Download the script wma2mp3_or_ogg.sh
2. Copy or Move the file(s) you want to convert to WRITABLE folders. If the files you want to convert are on a Microsoft NTFS drive, read the instructions at the bottom of this page. The script will convert wma files in the directory that they are at, AND will save the new ogg or mp3 file in the same place.
3. Notice: The script will convert wma files Recursively. That means it will convert wma files in the directory specified, and Every continuing directory.
4. Change the permissions on the script so that you may execute it.
$ chmod 744 wma2mp3_or_ogg.sh
5. To run the script, put the conversion after it, then your music directory. Example:
$ ./wma2mp3_or_ogg.sh -ogg /home/freddy/music_folder/
OR
$ ./wma2mp3_or_ogg.sh -mp3 /home/freddy/music_folder/



Dealing with an NTFS drive:
You will need to copy the files to a writable drive. You can copy them to your Linux drive or to a FAT32 drive. If you copy them to a Linux drive, you will want to make sure the permissions are set correctly after being copied. Example:
# copy the directory from ntfs drive to linux drive
cp /mnt/ntfs_drive/my_music/* /home/freddy/music_folder/
# change to the copied directory and set the permissions
cd /home/freddy/music_folder/
chmod 644 *

CoffeeMan
11-25-2004, 05:15 PM
Thanks, I used to use wma when I wass a windows man, but that has changed, I have re-ripped all of my (friends) cds. When I ripped them at the time, I used lame at 192kbs vbr. I have 5.1gb of mp3s. I would have ripped them to ogg, but I was planning on buying a Nomad Jukebox Zen Xtra, and I did. I love it, the only problem is that it only plays mp3 and wma. And I refuse to use wma now, so mp3 was the way to go.
What I really want to do, is build music server, I want to write a buch of scripts that would automate the ripping, encoding, freedb queries, and bittorrent/gnutella downloads. That would be sweet. I would add it to my home network, then I would find a way for the Nomad to read/decode ogg vorbis. (Plus, being an good, open, royalty-free format, how hard would it be for companies like Creative and Sony (and Apple) to add support for it)

retsaw
11-25-2004, 08:26 PM
Originally posted by Sepero
4. Change the permissions on the script so that you may execute it.
$ chmod 744 wma2mp3_or_ogg.sh

Shouldn't that be chmod 755?

There isn't a lot of point in letting other users have read permissions for the script and not execute permissions, there's no harm in it (in this case), but I can't see the point. :)

About wma, I've never liked the format even from before I started using linux, instead I made the effort of sifting through lots of shareware ripper-encoders to find one that I didn't need to pay money for, so I could rip my CDs to MP3. But if you already have wma files you shouldn't convert them to another lossy format unless you have to, it can only lead to losing a bit more of the original recording during re-encoding. I did a google and found a wma plugin for xmms (I don't know how well it works as I have no wma files to test it with). However for people who do have a genuine need to convert wma to ogg or mp3 this script is very useful.

Darkbolt
11-27-2004, 01:18 AM
hey, this is an awesome script...one feature request though..do you think you could add a flag like --delete-old-wma, where it deletes any wma it replaced with an ogg or mp3?