May 102012
 

If you search for instructions on cropping in Audacity, you’ll get a lot of people explaining how to do two things that you don’t want to do:

1. Remove a selected section (that is, cutting, the opposite of cropping)
2. Save a selection to a file

If you just want to select a range and remove everything on both sides, neither of those pieces of advice help. The confusion is caused by people answering questions they don’t understand, and the fact that Audacity uses the term “Trim” instead of crop. Of course, if you read an article like this one, you will be even more confused, because he uses the term “Trim” to mean Cut!

Anyhow, all you have to do is select the range you want, then Edit -> Remove Audio -> Trim. Or just hit Ctrl-T.

Update: Newer versions of Audacity moved Trim to Edit -> Remove Special -> Trim Audio.

Apr 272012
 

If you’re annoyed with the startup chime of your Mac, my friend Dan Tullis has developed an app that will cool your rage: Start Ninja will disable the startup chime so you won’t have to remember to turn your volume down before you shut down your machine.

Sep 242011
 

Recently, I needed to implement a minimal web server in C#. The .NET HTTP classes worked great, but there’s nothing built in to provide MIME types (other than looking in the registry, which I don’t trust to be complete/consistent). So I extracted the data from the Debian /etc/mime.types file for anything with a file extension and created a simple static class to do lookups for them.

Usage examples:

1
2
3
4
5
6
7
8
9
10
11
// do a lookup
String mimeType = MimeType.Get(".jpg");

// the dot is optional
String mimeType = MimeType.Get("jpg");

// non-existent extensions will return the default application/octet-stream type
String mimeType = MimeType.Get(".foo");

// you can also provide an explicit default type
String mimeType = MimeType.Get(".foo", "text/plain");

You can download MimeType.cs or view it in-line below.

Continue reading »

Aug 132011
 

Attention: This version of the SeekBar is obsolete, check out the new version instead

While working on my Android implementation of the Dislexicon, I realized I would need a SeekBar preference to adjust the text-to-speech speed. I found a couple of SeekBar prefs online, but none of them fit my needs. Specifically, I wanted it to:

  1. Appear on the main preference screen, instead of a separate window accessed via a button
  2. Fill the entire width of the screen
  3. Allow a minimum value other than zero

Here’s what I ended up with, as it appears in Dislexicon:

SeekBar Preference

Continue reading »