On linux I can play a sound file with the aplay program. I can also send audio data to /dev/dsp in some cases.
What is the Darwin analog of the aplay program? I need something that is purely a CLI-based solution.
Check out qtplay.
Edit: Oops, I forgot about the built-in afplay(1). The man page tells you less than the usage statement, though.
$ afplay -h
Usage: afplay [option...] audio_file Options: (may appear before or after arguments) {-v | --volume} VOLUME set the volume for playback of the file {-h | --help} print help { --leaks} run leaks analysis {-t | --time} TIME play for TIME seconds {-r | --rate} RATE play at playback rate {-q | --rQuality} QUALITY set the quality used for rate-scaled playback (default is 0 - low quality, 1 - high quality) {-d | --debug} debug print output