I am trying to convert an mp3 file to the format expected by the audio tag in the Amazon Alexa SSML markup language as described here: https://developer.amazon.com/public/soluti
Its a little confusing, and frankly a little odd that amazon requires this. mp3 files can be mpeg1 or mpeg2 or mpeg-2.5 (non standard, but widely supported). For this purpose, the main differences between the versions are bitrate and sample rate. Amazon requires 48kbps (which is supported in all mpeg versions). Next, mpeg-2 only supports sample rates of 22050 Hz, 24000 Hz, and 16000 Hz. So resampling to one of those frequencies should force ffmpeg to MPEG-2 layer 3.
ffmpeg -y -i input.mp3 -ar 16000 -ab 48k -codec:a libmp3lame -ac 1 output.mp3
more info here and here:
http://www.mp3-tech.org/programmer/frame_header.html
https://en.wikipedia.org/wiki/MP3