MP3 is not a file format, it's a container format.

FFmpeg should do what you want.