no additives or preservatives

kacked.com



Revising My Code

I'm tickled with myself. Tickled pink. Made some revisions to my lossless2aac script, pushed the changes to the server and the info at the bottom of the page updated automagically. The readme.txt at the bottom of the page is generated from running the script itself on the server. It's the same thing you would see if you ran it like this:

./lossless2aac -help

That way, the script is self-documenting, self-contained and anybody that wants can read the help file without downloading the script. Maybe not as cool as inventing the lightbulb but still kind of cool.

Funny, I only wrote this a couple weeks ago but I had to stare at it a bit before I could grok enough to change it. Reminds me how important it is to write transparent and readable code --the guy revising it later could be me!


Timed Recording Of Streaming Audio

I had written a script quite a while back which did this. It was running from cron so I could keep up with some of the radio shows I missed from the El Lay area. Alas... a hard drive crash put an end to that. It also resulted in my loss of the original script --thus prompting my recent investigation of source code management.

Anyway, I rewrote the script. It's now NEW AND IMPROVED. Since I've got an iPod now and not every stream is mp3, I've written it so that it can convert (on the fly) to iPod aac.

If you need to ask how this works or what it's for, it's probably not for you. Nothing to see here folks, move along...

download streamverter


iPod Audio Conversion On Linux

Been experimenting a lot with audio since my brother gave me an iPod shuffle for my birthday (thanks again Dan.) After the ordeal of just getting the thing to work on Linux, I've been trying to find a way to squeeze the highest quality sound onto the thing.

Sniffing around I've found that there are several different losslessly compressed audio formats. As I found losslessly compressed audio files in one format or another I had taken to writing scripts to convert them to aac using the FAAC encoder.

I went through a process of discovery where I would find some files in one format, write a script to convert them, then find files in another format and adapt the script to convert these as well. After doing this several times I decided to just re-write the script one more time. But this time to write it in a modular fashion, putting each type of conversion to wav into it's own subroutine so that I could more easily add other's in the future.

I had a bunch of fancy code that parsed the equivalent of the id3 tags for each of the various formats and then tagged the aac files. Sometimes it worked, sometimes it didn't (sometimes the info wasn't even there.) Since I couldn't get it to work consistently I shitcanned that section of code. Now there's a routine that prompts for the information. Stuff like: artist, album, genre, etc. Track title and number are parsed from the filenames.

The lossless formats I have run across so far are as follows:

Monkey's Audio (.ape)
FLAC (.flac)
Shorten (.shn)
Apple Lossless (.alac)

I'm sure I'll run into others at some point.

To use the script put it somewhere in your path, install the prerequisite software and run it. You have to do a little work up front to put the files into the format it likes. Make them look like this:

01 track title.ape
02 track title.flac
03 track title.shn
04 track title.alac

Usually you wouldn't have them all mixed up in the same folder like this. But if you do it will still work. Provided it's all the same album as the script will be prompting for artist, album name, etc.

download lossless2aac


Darcs -- Source Code Management

Learning how to use darcs to keep track of the scripts I've been working on. This has always been a good idea, I just never got around to doing it. But recently I lost a couple scripts I had written when a hard drive crashed.

Now I'll have a repository on my desktop and one on my web server. The added advantage of this is that other's will [maybe] be able to download and use the code I write.

"The Pragmatic Programmer":

Always Use Source Code Control. ALWAYS. Even if you are a single-person team on a one-week project. Even if it's a "throw-away" prototype. Even if stuff you're working on isn't source code. Make sure that everything is under source code control--documentation, phone number lists, memos to vendors, makefile, build and release procedures, that little shell script that burns the cd master--everything. We routinely use source code control on just about everything we type...



Nullam elementum neque a ante. Vestibulum sed urna hendrerit nibh egestas adipiscing. Ut gravida. Vivamus ut dolor. Mauris molestie elementum magna. Maecenas scelerisque feugiat erat. Sed nec risus. Phasellus eu nunc. Curabitur purus. Ut nonummy. Etiam sit amet mi quis felis suscipit tempus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque tincidunt ullamcorper massa. Duis elit.

Phasellus viverra dolor. Sed nulla dui, pharetra ut, faucibus ut, tempor sit amet, elit. Sed ut dui. Nunc quam nisl, sodales ut, molestie sit amet, tristique sit amet, pede. Donec ornare massa nec ligula. Morbi eget nunc in lectus vestibulum porttitor. Integer nec mauris mattis nibh elementum facilisis. Praesent wisi. Nullam eros sem, fringilla nec, venenatis non, ultrices nec, turpis. Curabitur et erat id mi auctor pulvinar. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus tempus, orci congue tincidunt ornare, felis libero tempor lectus, et lobortis eros lacus vitae lacus. Etiam tempus nunc quis wisi. Duis elementum blandit mauris. Etiam malesuada lorem et sem.

Nullam elementum neque a ante. Vestibulum sed urna hendrerit nibh egestas adipiscing. Ut gravida. Vivamus ut dolor. Mauris molestie elementum magna. Maecenas scelerisque feugiat erat. Sed nec risus. Phasellus eu nunc. Curabitur purus. Ut nonummy. Etiam sit amet mi quis felis suscipit tempus. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Quisque tincidunt ullamcorper massa. Duis elit.

Phasellus viverra dolor. Sed nulla dui, pharetra ut, faucibus ut, tempor sit amet, elit. Sed ut dui. Nunc quam nisl, sodales ut, molestie sit amet, tristique sit amet, pede. Donec ornare massa nec ligula. Morbi eget nunc in lectus vestibulum porttitor. Integer nec mauris mattis nibh elementum facilisis. Praesent wisi. Nullam eros sem, fringilla nec, venenatis non, ultrices nec, turpis. Curabitur et erat id mi auctor pulvinar. Vestibulum ante ipsum primis in faucibus orci luctus et ultrices posuere cubilia Curae; Phasellus tempus, orci congue tincidunt ornare, felis libero tempor lectus, et lobortis eros lacus vitae lacus. Etiam tempus nunc quis wisi. Duis elementum blandit mauris. Etiam malesuada lorem et sem.