/ R. Matthew Emerson / blog

Playing sounds from the command line

June 6, 2007

On the NeXT machine, there was a command called sndplay that would play .snd files from the command line.

It’s not too tough to put together a similar one for Mac OS X. We can play many more kinds of sounds than the old NeXT sndplay command did. On the other hand, since NSSound uses QuickTime to play some media formats, a run loop is required for sounds to keep playing, so that requires a few gyrations.

sndplay.m

(See also this cocoa-dev message)