SKwizard - Linux M4A Converter and file rename tool

Posted On Mar 07, 2008 at 1:53 am

As they say, you want something done right, you got to do it yourself! After my failed attempts to find a working tool to take care of 2 simple tasks on a large scale, I decided to write my own little program. Enter, SKwizard!

This shell script has two very useful abilities that are done recursively from any given starting point.

Features

File Renamer - This program will crawl your files/folders and not only replace all underscores with spaces, but will also capitalize the first letter of each word. I plan to add some more renaming options in the future but these two things were mainly what i was after.

M4A to MP3 Converter - This program will convert any M4A music files into MP3 - and retain the song tag information!

Usage

To use the program, all you have to do is run the command skwizard with the desired arguments (see below).

Convert m4a files to mp3 in linux

So say if you have your music collection at /storage/music/. You wanted to rename all files/folders and also convert any m4a files. Simply load up the command line and run skwizard -dfcr /storage/music/ - it will do its thing!

You can have it do any or all of the actions listed by themselves or together.

I ran this program against my 180gb music collection and am very happy with the results :)

View source code at: http://www.scottklarr.com/files/skwizard/skwizard

Installation

This script requires that you have LAME and FAAD2 installed in order to use the M4A to MP3 conversion. The file/folder renaming operations will work fine without these dependencies.

su cd /tmp wget http://www.scottklarr.com/files/skwizard/skwizard mv skwizard /bin/ chmod +x /bin/skwizard exit

Like I said above, I used this on my own music collection and it worked absolutely great (i did a lot of testing and triple checking before actually enabling the destructive commands). I am 99% sure it will work for you, but I have to say that I do not guarantee its performance. Use at your own risk.

This is my first shell script thats beyond just a couple lines, so there are probably better ways to do things, but I'm still new to it, so...

If you have any comments, suggestions, or ideas -- please let me know! This script is completely free to do with as you please. If you make any changes to it though, please send me a copy so i can see the improvements made!

Todo

  • See how reacts to permission denied.
  • Fix bug of renaming II, III to Ii, Iii.
  • Add more file renaming abilities with command line switches.

This topic has the following tags:

Last 5 Linkbacks

Comments (23)

Munra's Avatar

Munra Mar 09, 2008

Hi: again me.
Well i fund this, first i make a little change in you script (i don't know nothing about scripting i just see your script and make changes and wait to see what happend)
this was the change
=> your script:
faad -o - "$1" | lame --tt "$title" --ta "$artist" --tn "$track/$totaltracks" --tl "$album" $tg - "$newMp3Name"

=> the change
faad -o - "$1" | lame --tt "$title" --ta "$artist" --tn "$track/$totaltracks" --tl "$album" --tg "$genre" - "$newMp3Name"

So i delete $tg and put --tg "$genre", and works i have the genre of the mp3 file in Rhythmbox. But not with the first song, with another song that have the tag genre "Thecno" this is the info in terminal :

Motorway.m4a file info:
LC AAC 357.725 secs, 2 ch, 44100 Hz
title: Motorway
artist: Carl Cox
unknown: Various Artists
album: Carl Cox - F.A.C.T (Disk 2)
genre: Techno
track: 14
date: 1995

So when i try to convert the first song with the tag genre "Los Años Maravillosos", this is the info in terminal:

Tell it like it is.m4a file info:

LC AAC 163.007 secs, 2 ch, 44100 Hz

title: Tell it like it is
artist: Arron Neville
album: SuperHits 1967
genre: Los Años Maravillosos
track: 11

i have this message:

Unknown genre: 'Los Años Maravillosos'. Specify genre name or number.

I try with other directory and the same happend. This is the info of the other directory:

Somebody Save Me.m4a file info:

LC AAC 196.319 secs, 2 ch, 44100 Hz

title: Somebody Save Me
artist: Cinderella
unknown: Cinderella
writer: Tom Keifer
album: Night Songs
genre: Poser Rock
track: 7
date: 1986

in this is the message:
Unknown genre: 'Poser Rock'. Specify genre name or number.

Thanks again and I hope you give a answer.

I see that when i use you script without any change i still have the message with other mp3 file that have different genre, this is message

Unknown genre: '"Folk"'. Specify genre name or number.

So, with the genre '"Folk"' dont't work, but this time the message is little different have double quotes, this is:

Unknown genre: '"Folk"'. Specify genre name or number

But in Rhythmbox the genre in m4a is just Folk.

Thanks again and I hope you give a answer.

I going to see if i find why have problems with this genres, or mp3 files, probably are the file not the genre. Bye

P.D. I hope you understand me, because i have bad English and the addon "gtranslate" that i use for the words that i don't remember don't work in Firefox Beta 3.

Jean's Avatar

Jean Aug 28, 2009

Thanks.

Post Comment

You are replying to cancel reply

Your email address will not be visible to the public

Avatars by Gravatar. Join Gravatar for free to have your avatar shown everywhere you post.