Jul 10 2008
14:25 jctoast@hotmail.com
Jul 11 2008
05:31 jjjj
Jul 16 2008
14:50 Click to yabber
Jul 18 2008
20:17 Click to jabber
Jul 23 2008
14:02 how do you freaking get to the open door on 64
Jul 27 2008
23:53 awesome
Aug 5 2008
01:53 YABBERTIEM
Aug 10 2008
11:10 i wanna put this on my myspace, any clues
Aug 14 2008
22:33 <Jabber>
Aug 18 2008
07:21 Click to yabber
07:21 malllll
07:21 שלום שלום
23:10 <Jabber>
Aug 19 2008
06:18 helooo
Aug 20 2008
02:57 click to yabber
Aug 28 2008
09:40 any clues on level 68?

steike / code / playsound

For some reason there is no standard utility to play a sound file from a shell script. Well, here's one.

To use it, you just type

playsound foo.wav

You can download just the executable (Intel | PPC | ZIP file), or the source below. Place the file in /usr/local/bin, or wherever you feel comfortable with it. Such as inside your polish IM client :-)

Downlod this snippet as playsound.m

#import <Cocoa/Cocoa.h>

@interface Delegate : NSObject { }
@end

@implementation Delegate
- (void) sound: (NSSound *) sound didFinishPlaying: (BOOL) aBool
{
  [[NSApplication sharedApplication] terminate: nil];
}
@end


int main (int argc, char *argv[])
{
  if(argc!=2) {
    NSLog(@"usage: %s cowbell.wav", argv[0]);
    exit(1);
  }

  [[NSAutoreleasePool alloc] init];
  
  NSSound *sound = [[NSSound alloc]
		     initWithContentsOfFile: 
		       [NSString stringWithCString: argv[1]]
		     byReference: YES];
  
  [sound setDelegate: [[[Delegate alloc] init] autorelease]];
  [sound play];

  [[NSRunLoop currentRunLoop] run];

  return 1; // failed
}

Downlod this snippet as Makefile

test: playsound
	./playsound '/Applications/Mail.app/Contents/Resources/Mail Sent.aiff'
playsound: playsound.m Makefile
	gcc -o $@ -Wall -Os -framework Cocoa $<

[Comment on this]