I wrote a python library, pydub, that essentially does what Corey’s Answer suggests, though it uses ffmpeg in to do the conversions in order to support more formats.
from pydub import AudioSegment
AudioSegment.from_wav("/input/file.wav").export("/output/file.mp3", format="mp3")