However, you can do this:
$ ./soundprog > temp.au
Then open the resulting .au file in Audacity (http://audacity.sourceforge.net/). It'll play fine.
Not as simple just writing to a sound device, but it works.
First, Get sox. I prefer homebrew for Unix type stuff (http://mxcl.github.com/homebrew/), but it's likely MacPorts, Fink, and other sources have sox available too. If using Homebrew, just:
$ brew install sox
$ ./soundprog | sox -r 8000 -t u8 - -d