It's not a command line tool, but this does a great job at extracting the music: http://forums.terraria.org/index.php?threads/textract-extract-terrarias-images-sound-effects-and-music.937/
If you only want the music extracted, and not all the sounds, images, etc. Just put the "Wave Bank.xwb" in its own folder and point it at that.
EDIT: Oh, it can be operated through the command line. Check the bottom of the post in that thread.
If the file is less than 100MB, forget about it, they're crappy 48kbps WMA tracks. If it's the large new bank from the Mac+Linux versions, and possibly now from the Windows version, then they're MS ADPCM.
I've already uploaded a full set of them somewhere, let me see...