Playing sounds from the command line

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)

This entry was posted in cocoa, macosx. Bookmark the permalink.

One Response to Playing sounds from the command line

  1. Alberto says:

    YAY! Thank you! Thank you! Thank you! 🙂

Comments are closed.