2007-09-19 @ 08:55

Wasps Suck. Seriously.

Last night after nerd meeting I went home and went to bed. I rolled over and felt a prick in my leg, and it itched, so I turned on the light and looked at it. I didn’t think much of it, so I went back to bed. Then it started to hurt a lot. So I threw back the sheets and there was a fucking wasp in my bed. I hate wasps! I wouldn’t be as angry if I was stung by a bee. At least I get delicious honey from bees. Wasps don’t do anything for me! Arg! My leg totally hurts!

read more »

2007-09-21 @ 08:38

Decode MP3s with Ruby

Here is an example of decoding mp3s using ruby. First make sure to install icanhasaudio. It should just be a “gem install icanhasaudio”. Here is the code:

require 'rubygems'
require 'icanhasaudio'

reader = Audio::MPEG::Decoder.new
reader.decode(File.open(ARGV[0], 'rb'), $stdout)

icanhasaudio just takes two IO streams, an input and an output. In our case the input is the file provided on the command line, and the output is STDOUT. To use the script, simply do:

$ ruby decoder.rb phil_collins.mp3 > phil_collins.wav ~~~

read more »