I did it in this plugin a while ago. GitHub - scossar/m4a-audio-uploads: adds m4a to the Discourse audio file list · GitHub