Trying to get SoX running with MP3 support proved beyond me:1. The default download doesn't have it.
2. "Sox Wrap", a UI for withs own version of SoX won't do it, outputting a 0-byte file
3. I installed "Homebrew", a tool for installing extra software on OSX. I hoped "brew install sox --with-libmp3lame" or "brew install sox --with-mad --with-lame" might do it, but no. (troublingly, I can put --with-anystupidname and homebrew doesn't report that as a problem, so I have no way of knowing if the '--with's are working.)
4 I tried to follow the instructions at http://ggkarman.de/tech/building-sox-with-mp3-support-on-osx/ I'm not 100% sure I'm downloading the right tarballs, but when I tried to compile the sox part with --with-mad --with-lame it tells me can't find libmad, and I haven't done enough with compiling to know what I'm doing wrong.
So, the solution turned out to be downloading LAME (which besides providing libraries for other programs also has its own commandline tool) and then doing a two step process:
sox wonky.wav -b 16 better.wav
lame better.wav --preset medium better.mp3
(Sox is much better at reading the wonky wav file, so it still has to be in the loop.)